mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
Update client actions and dashboard labels
Show client edit and delete actions directly in grid and list views, simplify work-order and dashboard metric labels, and adjust spacing for milestone timelines without upcoming milestones.
This commit is contained in:
@@ -31,19 +31,19 @@ export default function HomeTask({ clients = [] }: HomeTaskProps) {
|
||||
trend: null,
|
||||
},
|
||||
{
|
||||
title: 'Active Projects',
|
||||
title: 'Projects',
|
||||
value: stats.activeProjects,
|
||||
icon: FolderGit2,
|
||||
trend: stats.projectsTrend,
|
||||
},
|
||||
{
|
||||
title: 'Active Internal Memos',
|
||||
title: 'Internal Memos',
|
||||
value: stats.activeInternalMemos,
|
||||
icon: ClipboardClock,
|
||||
trend: stats.personnelTrend,
|
||||
},
|
||||
{
|
||||
title: 'Active Work Orders',
|
||||
title: 'Work Orders',
|
||||
value: stats.activeWorkOrders,
|
||||
icon: FileText,
|
||||
trend: stats.workOrdersTrend,
|
||||
@@ -91,7 +91,7 @@ export default function HomeTask({ clients = [] }: HomeTaskProps) {
|
||||
<span className="text-xl md:text-3xl font-extrabold tracking-tight text-foreground">
|
||||
{card.value}
|
||||
</span>
|
||||
{card.trend && (
|
||||
{/* {card.trend && (
|
||||
<div className="flex flex-col text-[10px] leading-tight font-medium pl-0.5">
|
||||
<span className="text-emerald-600 dark:text-emerald-400 font-bold flex items-center gap-0.5 whitespace-nowrap">
|
||||
↑ {card.trend}
|
||||
@@ -100,7 +100,7 @@ export default function HomeTask({ clients = [] }: HomeTaskProps) {
|
||||
vs last month
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
</div>
|
||||
</Card900>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { motion } from 'motion/react';
|
||||
import Link from 'next/link';
|
||||
import { ExternalLink, MoreHorizontal, FileText, Users, ClipboardList } from 'lucide-react';
|
||||
import { ExternalLink, MoreHorizontal, FileText, Users, ClipboardList, PencilLine, Trash } from 'lucide-react';
|
||||
import { Card900 } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { LazyImage } from '@/components/ui/lazy-image';
|
||||
@@ -122,33 +122,6 @@ export default function ClientGrid({ clients, onEdit, onDelete }: ClientGridProp
|
||||
</HoverCard>
|
||||
</div>
|
||||
|
||||
{/* Dropdown Action Menu */}
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
aria-label="Client actions"
|
||||
>
|
||||
<MoreHorizontal className="w-4 h-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/task/client-detail/${client.id}`}>View Client Detail</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={() => onEdit(client)}>
|
||||
Edit Client
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onSelect={() => onDelete(client)}
|
||||
className="text-destructive focus:text-destructive"
|
||||
>
|
||||
Delete Client
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
|
||||
{/* Client Brand Logo & Corporate Name */}
|
||||
@@ -271,16 +244,35 @@ export default function ClientGrid({ clients, onEdit, onDelete }: ClientGridProp
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Link href={`/task/client-detail/${client.id}`}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="text-xs h-7.5 px-2.5 gap-1 hover:bg-accent"
|
||||
<div className='flex items-center gap-1.5'>
|
||||
<Link href={`/task/client-detail/${client.id}`}>
|
||||
<Button
|
||||
variant='default'
|
||||
size="sm"
|
||||
className="text-xs h-7.5 px-2.5 gap-1 hover:bg-accent"
|
||||
>
|
||||
<span>Detail</span>
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</Button>
|
||||
</Link>
|
||||
<Button onClick={() => onEdit(client)}
|
||||
title='Update Client'
|
||||
size='icon-sm'
|
||||
variant='outline'
|
||||
className='text-teal-500'
|
||||
>
|
||||
<span>Detail</span>
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
<PencilLine />
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
<Button onClick={() => onDelete(client)}
|
||||
title='Delete Client'
|
||||
size='icon-sm'
|
||||
variant='outline'
|
||||
className='text-rose-500'
|
||||
>
|
||||
<Trash />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card900>
|
||||
</motion.div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { motion } from 'motion/react';
|
||||
import Link from 'next/link';
|
||||
import { FileText, Users, ClipboardList, MoreHorizontal, ExternalLink } from 'lucide-react';
|
||||
import { FileText, Users, ClipboardList, MoreHorizontal, ExternalLink, Trash, PencilLine } from 'lucide-react';
|
||||
import { Card900 } from '@/components/ui/card';
|
||||
import { LazyImage } from '@/components/ui/lazy-image';
|
||||
import { Button } from '@/components/ui/button';
|
||||
@@ -21,19 +21,16 @@ import { IClient, CLIENT_FALLBACK_IMAGE } from '../../types';
|
||||
import { getProjectStatusBreakdown } from '../../utils/client-overview-helpers';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
const ClientMilestoneTimeline = dynamic(
|
||||
() => import('./ClientMilestoneTimeline'),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => (
|
||||
<div className="h-14 sm:h-16 w-full rounded-xl bg-muted/20 border border-border/40 animate-pulse flex items-center justify-between px-4 my-1">
|
||||
<div className="h-2.5 w-16 sm:w-20 rounded bg-muted/60" />
|
||||
<div className="h-1 flex-1 mx-4 sm:mx-8 rounded-full bg-muted/40" />
|
||||
<div className="h-2.5 w-14 sm:w-16 rounded bg-muted/60" />
|
||||
</div>
|
||||
),
|
||||
}
|
||||
);
|
||||
const ClientMilestoneTimeline = dynamic(() => import('./ClientMilestoneTimeline'), {
|
||||
ssr: false,
|
||||
loading: () => (
|
||||
<div className="h-14 sm:h-16 w-full rounded-xl bg-muted/20 border border-border/40 animate-pulse flex items-center justify-between px-4 my-1">
|
||||
<div className="h-2.5 w-16 sm:w-20 rounded bg-muted/60" />
|
||||
<div className="h-1 flex-1 mx-4 sm:mx-8 rounded-full bg-muted/40" />
|
||||
<div className="h-2.5 w-14 sm:w-16 rounded bg-muted/60" />
|
||||
</div>
|
||||
),
|
||||
});
|
||||
|
||||
interface ClientListProps {
|
||||
clients: IClient[];
|
||||
@@ -240,7 +237,7 @@ export default function ClientList({ clients, onEdit, onDelete }: ClientListProp
|
||||
<div className="flex items-center justify-between text-xs py-1 border-b border-border/30">
|
||||
<div className="flex items-center gap-2 text-muted-foreground">
|
||||
<ClipboardList className="w-4 h-4 text-muted-foreground" />
|
||||
<span>Active Work Orders</span>
|
||||
<span>Work Orders</span>
|
||||
</div>
|
||||
<span className="font-bold text-foreground text-sm">{activeWorkOrders}</span>
|
||||
</div>
|
||||
@@ -250,41 +247,32 @@ export default function ClientList({ clients, onEdit, onDelete }: ClientListProp
|
||||
<div className="flex items-center justify-end gap-2 pt-2">
|
||||
<Link href={`/task/client-detail/${client.id}`} className="flex-1">
|
||||
<Button
|
||||
variant="outline"
|
||||
variant='default'
|
||||
size="sm"
|
||||
className="w-full text-xs h-8 gap-1.5 hover:bg-accent"
|
||||
className="w-full text-xs h-8 gap-1.5"
|
||||
>
|
||||
<span>View Detail</span>
|
||||
<ExternalLink className="w-3.5 h-3.5" />
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
aria-label="Client actions"
|
||||
>
|
||||
<MoreHorizontal className="w-4 h-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/task/client-detail/${client.id}`}>View Client Detail</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={() => onEdit(client)}>
|
||||
Edit Client
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onSelect={() => onDelete(client)}
|
||||
className="text-destructive focus:text-destructive"
|
||||
>
|
||||
Delete Client
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Button onClick={() => onEdit(client)}
|
||||
title='Update Client'
|
||||
size='icon-sm'
|
||||
variant='outline'
|
||||
className='text-teal-500'
|
||||
>
|
||||
<PencilLine />
|
||||
</Button>
|
||||
|
||||
<Button onClick={() => onDelete(client)}
|
||||
title='Delete Client'
|
||||
size='icon-sm'
|
||||
variant='outline'
|
||||
className='text-rose-500'
|
||||
>
|
||||
<Trash />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -150,7 +150,7 @@ export default function ClientMilestoneTimeline({ client, variant = 'list' }: Cl
|
||||
|
||||
{/* Timeline Viewport Container with group/rail for sibling hover coordination */}
|
||||
<div className={cn("w-full min-w-0", isGrid ? "" : "overflow-x-auto scrollbar-hide")}>
|
||||
<div className={cn("relative pt-3 group/rail", hasAgendas && !isGrid ? 'mb-20' : 'mb-10', isGrid ? "px-3" : "min-w-105 px-6")}>
|
||||
<div className={cn("relative pt-3 group/rail", !hasAgendas && !isGrid ? 'pb-6' : '', hasAgendas && !isGrid ? 'mb-20' : 'mb-10', isGrid ? "px-3" : "min-w-105 px-6")}>
|
||||
{/* Continuous 2-Month Horizontal Rail */}
|
||||
<div className="relative h-1.5 sm:h-2 w-full bg-zinc-200/70 dark:bg-zinc-700/50 rounded-full">
|
||||
{/* Gradient Segments connecting Hari Ini -> Agenda 1 -> Agenda 2 -> ... */}
|
||||
@@ -200,7 +200,7 @@ export default function ClientMilestoneTimeline({ client, variant = 'list' }: Cl
|
||||
{/* If no milestones in range, show gentle notice */}
|
||||
{!hasAgendas && (
|
||||
<div className="absolute inset-0 flex items-center justify-center pointer-events-none">
|
||||
<span className={`text-[10px] text-muted-foreground/70 italic ${!isGrid ? 'mt-8' : 'mt-18'} select-none whitespace-nowrap`}>
|
||||
<span className={`text-[10px] text-muted-foreground/70 italic mt-20 select-none whitespace-nowrap`}>
|
||||
No upcoming milestones in the next 2 months
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user