mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 10:46:27 +00:00
d3c4e21636
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.
39 lines
1.3 KiB
TypeScript
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} />;
|
|
} |