mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 12:36:27 +00:00
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.
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { BookOpenCheck } from 'lucide-react';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
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 searchParams = useSearchParams();
|
||||
const layout = searchParams?.get('layout') === 'list' ? 'list' : initialLayout;
|
||||
const currentLayout = layout || initialLayout;
|
||||
|
||||
if (data.length === 0) {
|
||||
return (
|
||||
@@ -33,7 +31,7 @@ export default function AssignmentTable({
|
||||
);
|
||||
}
|
||||
|
||||
if (layout === 'list') {
|
||||
if (currentLayout === 'list') {
|
||||
return <AssignmentList assignments={data} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user