From dcb74c0f2bd3f3f5e7db66435935ba79536906a2 Mon Sep 17 00:00:00 2001 From: Ichsan Kurniawan Date: Tue, 5 May 2026 16:06:13 +0700 Subject: [PATCH] Add HoverCard and UI/status tweaks Introduce a reusable HoverCard component (components/ui/hover-card.tsx) and integrate it into the client grid to show a status summary with badges. Import the cn helper and BadgeStatus in ClientGrid, add a status pill trigger with animated indicator, and switch displayed client reference from end_user_name to client.name. In ManageTeam, include id in draftData, replace BadgeStatus rendering with a Badge variant and adjust the edit button colors to teal; the same teal edit-button color change was applied to UpdateTimelineStatus. Remove an unnecessary comment line in the task page. These changes improve status visibility and unify UI affordances. --- app/(dashboard)/task/component/ClientGrid.tsx | 43 +++++++++++++++++- app/(dashboard)/task/component/ManageTeam.tsx | 5 ++- .../task/component/UpdateTimelineStatus.tsx | 2 +- app/(dashboard)/task/page.tsx | 1 - components/ui/hover-card.tsx | 44 +++++++++++++++++++ 5 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 components/ui/hover-card.tsx diff --git a/app/(dashboard)/task/component/ClientGrid.tsx b/app/(dashboard)/task/component/ClientGrid.tsx index 90bead3..fec0f6a 100644 --- a/app/(dashboard)/task/component/ClientGrid.tsx +++ b/app/(dashboard)/task/component/ClientGrid.tsx @@ -18,6 +18,11 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; import FormClient from './FormClient'; import { ConfirmDeleteWithInput } from '@/components/modal/ConfirmDeleteWithInput'; +import { + HoverCard, HoverCardContent, HoverCardTrigger, +} from "@/components/ui/hover-card" +import { cn } from '@/lib/utils'; +import BadgeStatus from '@/components/ui/badge-status'; export default function ClientGrid({ clients }: { clients: IClient[] }) { const router = useRouter(); @@ -70,10 +75,44 @@ export default function ClientGrid({ clients }: { clients: IClient[] }) { className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" />
+
+ + +
+
+ {client.status_name.toLowerCase() === 'active' && + + } +
+
+ + {client.status_name} + +
+ + + +
Status Summary
+
This is status summary information from WO or IM related to this client.
+
+ {client.project_status_summary.map((item, key) => +
+ +
{item.total}
+
+ )} +
+
+
+ +

{client.name}

-

{client.end_user_name}

+ {/*

{client.end_user_name}

*/}
diff --git a/app/(dashboard)/task/page.tsx b/app/(dashboard)/task/page.tsx index 1e2b5d7..89fb940 100644 --- a/app/(dashboard)/task/page.tsx +++ b/app/(dashboard)/task/page.tsx @@ -30,7 +30,6 @@ export default async function ClientsPage({ searchParams }: Props) { return (
- {/* The Shell manages the Search Input, Tabs, and "Add Client" Modal */} {/* Render the correct view based on the URL */} diff --git a/components/ui/hover-card.tsx b/components/ui/hover-card.tsx new file mode 100644 index 0000000..91e869c --- /dev/null +++ b/components/ui/hover-card.tsx @@ -0,0 +1,44 @@ +"use client" + +import * as React from "react" +import { HoverCard as HoverCardPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +function HoverCard({ + ...props +}: React.ComponentProps) { + return +} + +function HoverCardTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function HoverCardContent({ + className, + align = "center", + sideOffset = 4, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +export { HoverCard, HoverCardTrigger, HoverCardContent }