diff --git a/frontend/app/app/locations/page.tsx b/frontend/app/app/locations/page.tsx new file mode 100644 index 00000000..c3007965 --- /dev/null +++ b/frontend/app/app/locations/page.tsx @@ -0,0 +1,70 @@ +"use client" + +import { useState } from "react" +import { Plus, ChevronRight, ChevronDown, MapPin } from "lucide-react" +import { Button } from "@/components/ui/button" + +interface Location { + id: string + name: string + type: "building" | "floor" | "room" + parent: string | null + assetCount: number +} + +const MOCK: Location[] = [ + { id: "1", name: "HQ Building", type: "building", parent: null, assetCount: 120 }, + { id: "2", name: "Floor 1", type: "floor", parent: "1", assetCount: 60 }, + { id: "3", name: "Server Room", type: "room", parent: "2", assetCount: 25 }, + { id: "4", name: "Floor 2", type: "floor", parent: "1", assetCount: 60 }, + { id: "5", name: "IT Department", type: "room", parent: "4", assetCount: 35 }, +] + +function LocationRow({ loc, depth }: { loc: Location; depth: number }) { + const [open, setOpen] = useState(true) + const children = MOCK.filter(l => l.parent === loc.id) + const hasChildren = children.length > 0 + + return ( + <> + + +
+ {hasChildren + ? + : } + + {loc.name} +
+ + {loc.type} + {loc.assetCount} + + + + + + {open && children.map(c => )} + + ) +} + +export default function LocationsPage() { + const roots = MOCK.filter(l => l.parent === null) + return ( +
+
+

Locations

Hierarchical location tree with CRUD

+ +
+
+ + + {["Name","Type","Assets","Actions"].map(h=>)} + + {roots.map(r=>)} +
{h}
+
+
+ ) +} \ No newline at end of file