Remove action card selected state and add greeting translations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ba2045fb40
commit
080d3a98f3
3 changed files with 13 additions and 15 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { FolderPlus, MessageCircle, PlusCircle, UserPlus } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ActionCard } from "./ActionCard";
|
||||
|
||||
|
|
@ -9,20 +8,12 @@ export interface DashboardActionCardsProps {
|
|||
onSendMessage?: () => void;
|
||||
}
|
||||
|
||||
type CardId = "createProject" | "createTask" | "inviteTeam" | "sendMessage";
|
||||
|
||||
export function DashboardActionCards({
|
||||
onCreateProject,
|
||||
onCreateTask,
|
||||
onSendMessage,
|
||||
}: DashboardActionCardsProps) {
|
||||
const { t } = useTranslation("pages");
|
||||
const [selected, setSelected] = useState<CardId | null>(null);
|
||||
|
||||
const handleClick = (id: CardId, callback?: () => void) => {
|
||||
setSelected(id);
|
||||
callback?.();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-5">
|
||||
|
|
@ -30,16 +21,14 @@ export function DashboardActionCards({
|
|||
icon={<FolderPlus className="w-6 h-6" />}
|
||||
label={t("dashboard.actionCards.createProject.label")}
|
||||
description={t("dashboard.actionCards.createProject.description")}
|
||||
isSelected={selected === "createProject"}
|
||||
onClick={() => handleClick("createProject", onCreateProject)}
|
||||
onClick={onCreateProject}
|
||||
/>
|
||||
|
||||
<ActionCard
|
||||
icon={<PlusCircle className="w-6 h-6" />}
|
||||
label={t("dashboard.actionCards.createTask.label")}
|
||||
description={t("dashboard.actionCards.createTask.description")}
|
||||
isSelected={selected === "createTask"}
|
||||
onClick={() => handleClick("createTask", onCreateTask)}
|
||||
onClick={onCreateTask}
|
||||
/>
|
||||
|
||||
<ActionCard
|
||||
|
|
@ -54,8 +43,7 @@ export function DashboardActionCards({
|
|||
icon={<MessageCircle className="w-6 h-6" />}
|
||||
label={t("dashboard.actionCards.sendMessage.label")}
|
||||
description={t("dashboard.actionCards.sendMessage.description")}
|
||||
isSelected={selected === "sendMessage"}
|
||||
onClick={() => handleClick("sendMessage", onSendMessage)}
|
||||
onClick={onSendMessage}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"tablo": {
|
||||
"greeting": {
|
||||
"morning": "Good Morning",
|
||||
"afternoon": "Good Afternoon",
|
||||
"evening": "Good Evening"
|
||||
},
|
||||
"title": "Projects",
|
||||
"subtitle": "Manage your projects and collaborations",
|
||||
"createButton": "New project",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"tablo": {
|
||||
"greeting": {
|
||||
"morning": "Bonjour",
|
||||
"afternoon": "Bonjour",
|
||||
"evening": "Bonsoir"
|
||||
},
|
||||
"title": "Projets",
|
||||
"subtitle": "Gérez vos projets et collaborations",
|
||||
"createButton": "Nouveau projet",
|
||||
|
|
|
|||
Loading…
Reference in a new issue