From e6ccda70d2c3b05393f23732faf66ae3920f89dd Mon Sep 17 00:00:00 2001 From: Forge Date: Thu, 26 Mar 2026 07:57:56 +0800 Subject: [PATCH] chore: remove orphaned shadcn settings sub-pages (wrong design system); design rules added to FORGE_NOTES --- app/(app)/settings/areas/page.tsx | 93 ----------------------- app/(app)/settings/plans/page.tsx | 31 -------- app/(app)/settings/tenant/page.tsx | 43 ----------- app/(app)/settings/users/page.tsx | 116 ----------------------------- 4 files changed, 283 deletions(-) delete mode 100644 app/(app)/settings/areas/page.tsx delete mode 100644 app/(app)/settings/plans/page.tsx delete mode 100644 app/(app)/settings/tenant/page.tsx delete mode 100644 app/(app)/settings/users/page.tsx diff --git a/app/(app)/settings/areas/page.tsx b/app/(app)/settings/areas/page.tsx deleted file mode 100644 index 7837725..0000000 --- a/app/(app)/settings/areas/page.tsx +++ /dev/null @@ -1,93 +0,0 @@ -'use client'; - -import { useQuery } from '@tanstack/react-query'; -import { Card, CardContent } from '@/components/ui/card'; -import { Button } from '@/components/ui/button'; -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 ( -
-
-
-

Areas & Zones

-

Service area and coverage zones

-
-
- - -
-
- - {isLoading ? ( -
- {Array.from({ length: 3 }).map((_, i) => ( - - ))} -
- ) : areas.length === 0 ? ( -
- -

No service areas yet

-
- ) : ( -
- {areas.map((area) => ( - - -
-
-
- -
-
-

{area.name}

- {area.description &&

{area.description}

} - {area.zones && area.zones.length > 0 && ( -
- {area.zones.map(z => ( - - {z.name} - - ))} -
- )} -
-
-
- {area.zones?.length ?? 0} zone{(area.zones?.length ?? 0) !== 1 ? 's' : ''} - -
-
-
-
- ))} -
- )} -
- ); -} diff --git a/app/(app)/settings/plans/page.tsx b/app/(app)/settings/plans/page.tsx deleted file mode 100644 index 40ec6a5..0000000 --- a/app/(app)/settings/plans/page.tsx +++ /dev/null @@ -1,31 +0,0 @@ -'use client'; - -import { Card, CardContent } from '@/components/ui/card'; -import { Button } from '@/components/ui/button'; -import { Plus } from 'lucide-react'; - -export default function PlansPage() { - return ( -
-
-
-

Service Plans

-

Manage internet subscription plans

-
- -
- -
- - - -

Create your first plan

-
-
-
-
- ); -} diff --git a/app/(app)/settings/tenant/page.tsx b/app/(app)/settings/tenant/page.tsx deleted file mode 100644 index aa06418..0000000 --- a/app/(app)/settings/tenant/page.tsx +++ /dev/null @@ -1,43 +0,0 @@ -'use client'; - -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import { Button } from '@/components/ui/button'; - -export default function TenantSettingsPage() { - return ( -
-
-

Tenant Settings

-

Configure your ISP business details

-
- - - - Business Information - Update your ISP company details - - -
- - -
-
- - -
-
- - -
-
- - -
- -
-
-
- ); -} diff --git a/app/(app)/settings/users/page.tsx b/app/(app)/settings/users/page.tsx deleted file mode 100644 index 64dc36f..0000000 --- a/app/(app)/settings/users/page.tsx +++ /dev/null @@ -1,116 +0,0 @@ -'use client'; - -import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; -import { api } from '@/lib/api'; -import { Card, CardContent } from '@/components/ui/card'; -import { Skeleton } from '@/components/ui/skeleton'; -import { Badge } from '@/components/ui/badge'; -import { UserPlus } from 'lucide-react'; - -interface User { - id: string; - firstName: string; - lastName: string; - email: string; - isActive: boolean; - roles: Array<{ role: string }>; -} - -const roleColors: Record = { - ADMIN: 'bg-purple-100 text-purple-700', - STAFF: 'bg-blue-100 text-blue-700', - TECHNICIAN: 'bg-orange-100 text-orange-700', - COLLECTOR: 'bg-green-100 text-green-700', -}; - -export default function UsersSettingsPage() { - const qc = useQueryClient(); - - const { data: users, isLoading } = useQuery({ - queryKey: ['users'], - queryFn: async () => { - const res = await api.get('/api/v1/users'); - return res.data; - }, - }); - - const toggleActive = useMutation({ - mutationFn: async ({ id, isActive }: { id: string; isActive: boolean }) => { - await api.patch(`/api/v1/users/${id}`, { isActive: !isActive }); - }, - onSuccess: () => qc.invalidateQueries({ queryKey: ['users'] }), - }); - - return ( -
-
-
-

Users

-

Manage staff access and roles

-
- -
- - - - - - - - - - - - - - - {isLoading - ? Array.from({ length: 4 }).map((_, i) => ( - - {[...Array(5)].map((_, j) => ( - - ))} - - )) - : users?.map((u) => { - const role = u.roles?.[0]?.role ?? 'STAFF'; - return ( - - - - - - - - ); - })} - -
NameEmailRoleStatus
- {u.firstName} {u.lastName} - {u.email} - - {role} - - - - {u.isActive ? 'Active' : 'Inactive'} - - - -
-
-
-
- ); -}