Files
Ichsan Kurniawan d3c4e21636 Simplify task dashboard to client view
This change removes the assignment-view toggle from the task dashboard and keeps the page focused on clients, while preserving layout selection behavior with an explicit grid/list state. It also updates the shared Manage Team and Timeline Status modals to use the Dialog component, fixes their close handling, and adds a # prefix to assignment codes for clearer labeling.
2026-10-07 18:25:46 +07:00

39 lines
1.3 KiB
TypeScript

import { Card } from '@/components/ui/card';
import { BookOpenCheck } from 'lucide-react';
import { IProjectAssignment } from '../../type.assignment';
import AssignmentGrid from './AssignmentGrid';
import AssignmentList from './AssignmentList';
interface AssignmentTableProps {
data: IProjectAssignment[];
layout?: 'grid' | 'list';
initialLayout?: 'grid' | 'list';
}
export default function AssignmentTable({
data,
layout,
initialLayout = 'grid',
}: AssignmentTableProps) {
const currentLayout = layout || initialLayout;
if (data.length === 0) {
return (
<Card className="py-12 text-center border-2 border-dashed rounded-xl">
<BookOpenCheck className="w-12 h-12 mx-auto text-muted-foreground opacity-20" />
<div className="text-center">
<h3 className="text-xl font-semibold">No Project Assignment Found</h3>
<p className="text-muted-foreground max-w-sm mx-auto mt-2">
Try to change the filter or create one to get started.
</p>
</div>
</Card>
);
}
if (currentLayout === 'list') {
return <AssignmentList assignments={data} />;
}
return <AssignmentGrid assignments={data} />;
}