diff --git a/app/(dashboard)/plans/plans-client.tsx b/app/(dashboard)/plans/plans-client.tsx index b1c5c74..ad0efb3 100644 --- a/app/(dashboard)/plans/plans-client.tsx +++ b/app/(dashboard)/plans/plans-client.tsx @@ -6,9 +6,11 @@ import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Progress } from '@/components/ui/progress' +import { Switch } from '@/components/ui/switch' import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' -import { Plus, Calendar, Users, Filter, ArrowUpRight, Clock } from 'lucide-react' +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' +import { Plus, Calendar, Users, Filter, ArrowUpRight, Clock, List, LayoutGrid } from 'lucide-react' import type { CodePlanStatus, CodePlanType } from '@/lib/types' import { cn, formatDate } from '@/lib/utils' import { PlanCreatePanel } from './plan-create-panel' @@ -57,6 +59,7 @@ export function PlansClient({ plans, products, currentUserId }: { plans: Plan[]; const [mineOnly, setMineOnly] = useState(false) const [statusFilter, setStatusFilter] = useState('open') const [productFilter, setProductFilter] = useState('all') + const [view, setView] = useState<'card' | 'list'>('card') const filteredPlans = plans.filter((plan) => { if (mineOnly && plan.ownerId !== currentUserId && !plan.assigneeIds.includes(currentUserId ?? '')) return false @@ -131,13 +134,10 @@ export function PlansClient({ plans, products, currentUserId }: { plans: Plan[]; Completed - +
+
+ + +
- {/* Plans List */} -
- {filteredPlans.map((plan) => ( - - -
-
-
- + {/* Plans */} + {filteredPlans.length === 0 ? ( + + + +

No plans found

+

+ {statusFilter !== 'all' || productFilter !== 'all' + ? 'Try adjusting your filters' + : 'Create your first code plan to get started'} +

+ + + Create Plan + + } + /> +
+
+ ) : view === 'list' ? ( + + + + + Plan + Type + Status + Product + Progress + Deadline + + + + {filteredPlans.map((plan) => ( + + + + {plan.title} + + + + + {typeLabels[plan.type]} + + + + + {plan.status} + + + +
{plan.productName}
+
+ +
+ + {plan.progress}% +
+
+ + {plan.deadline ? formatDate(plan.deadline) : '-'} + +
+ ))} +
+
+
+ ) : ( +
+ {filteredPlans.map((plan) => ( + + +
+
+ {plan.title} +
+
{typeLabels[plan.type]} @@ -173,7 +257,7 @@ export function PlansClient({ plans, products, currentUserId }: { plans: Plan[];

{plan.description}

-
+
{plan.productName} {plan.deadline && (
@@ -189,7 +273,7 @@ export function PlansClient({ plans, products, currentUserId }: { plans: Plan[]; )}
-
+
Progress {plan.progress}% @@ -199,42 +283,18 @@ export function PlansClient({ plans, products, currentUserId }: { plans: Plan[]; {plan.completedTaskCount} / {plan.taskCount} tasks
-
- {plan.tags.length > 0 && ( -
- {plan.tags.map((tag) => ( - {tag} - ))} -
- )} - - - ))} - - {filteredPlans.length === 0 && ( - - - -

No plans found

-

- {statusFilter !== 'all' || productFilter !== 'all' - ? 'Try adjusting your filters' - : 'Create your first code plan to get started'} -

- - - Create Plan - - } - /> -
-
- )} -
+ {plan.tags.length > 0 && ( +
+ {plan.tags.map((tag) => ( + {tag} + ))} +
+ )} + + + ))} +
+ )} ) } diff --git a/app/(dashboard)/tasks/tasks-client.tsx b/app/(dashboard)/tasks/tasks-client.tsx index b8d2b6f..8d21556 100644 --- a/app/(dashboard)/tasks/tasks-client.tsx +++ b/app/(dashboard)/tasks/tasks-client.tsx @@ -10,6 +10,7 @@ import { Avatar, AvatarFallback } from '@/components/ui/avatar' import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' +import { Switch } from '@/components/ui/switch' import { Clock, Filter, CheckCircle2, Circle, Play, LayoutGrid, List, Plus } from 'lucide-react' import type { TaskStatus } from '@/lib/types' import { cn } from '@/lib/utils' @@ -285,13 +286,13 @@ export function TasksClient({ Done - +