diff --git a/app/(app)/settings/areas/page.tsx b/app/(app)/settings/areas/page.tsx index 02c5e96..7837725 100644 --- a/app/(app)/settings/areas/page.tsx +++ b/app/(app)/settings/areas/page.tsx @@ -1,30 +1,93 @@ 'use client'; +import { useQuery } from '@tanstack/react-query'; import { Card, CardContent } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; -import { Plus, MapPin } from 'lucide-react'; +import { Skeleton } from '@/components/ui/skeleton'; +import { MapPin, Plus, ChevronRight } from 'lucide-react'; +import { api } from '@/lib/api'; + +interface Zone { + id: string; + name: string; +} +interface Area { + id: string; + name: string; + description?: string; + zones?: Zone[]; +} export default function AreasPage() { + const { data, isLoading } = useQuery({ + queryKey: ['areas'], + queryFn: async () => (await api.get('/api/v1/areas')).data, + }); + + const areas: Area[] = Array.isArray(data) ? data : (data?.data ?? []); + return (
Define service coverage areas
+Service area and coverage zones
+No areas defined yet
-Create areas to group clients by coverage zone
-No service areas yet
+{area.name}
+ {area.description &&{area.description}
} + {area.zones && area.zones.length > 0 && ( +Manage staff accounts and permissions
+Staff accounts and role assignments
Support, installation, and billing issues
+{total} tickets
| Subject | +Client | +Type | +Priority | +Status | +Assigned | +Created | ++ |
|---|---|---|---|---|---|---|---|
| + {t.subject} + | +
+ {t.client ? `${t.client.firstName} ${t.client.lastName}` : '—'}
+ {t.client?.accountNumber}
+ |
+ + + {t.type} + + | ++ + {t.priority} + + | ++ + {t.status?.replace('_', ' ')} + + | ++ {t.assignedTo ? `${t.assignedTo.firstName} ${t.assignedTo.lastName}` : 'Unassigned'} + | ++ {t.createdAt ? format(new Date(t.createdAt), 'MMM d') : '—'} + | +