diff --git a/frontend/app/(sidebar)/inventory/page.tsx b/frontend/app/(sidebar)/inventory/page.tsx index 290461b..3a9437e 100644 --- a/frontend/app/(sidebar)/inventory/page.tsx +++ b/frontend/app/(sidebar)/inventory/page.tsx @@ -6,15 +6,40 @@ import { Calendar, ChevronDown, Plus, Search } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; -import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; -import { Pagination, PaginationContent, PaginationItem, PaginationLink } from "@/components/ui/pagination"; -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { + Pagination, + PaginationContent, + PaginationItem, + PaginationLink, +} from "@/components/ui/pagination"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; import { Calendar as CalendarComponent } from "@/components/ui/calendar"; import { Badge } from "@/components/ui/badge"; import { fetchInventoryItems } from "@/api/inventory"; import { AddInventoryItem } from "./add-inventory-item"; +import { EditInventoryItem } from "./edit-inventory-item"; +import { DeleteInventoryItem } from "./delete-inventory-item"; export default function InventoryPage() { const [date, setDate] = useState(); @@ -33,12 +58,18 @@ export default function InventoryPage() { }); if (isLoading) { - return
Loading...
; + return ( +
+ Loading... +
+ ); } if (isError || !inventoryItems) { return ( -
Error loading inventory data.
+
+ Error loading inventory data. +
); } @@ -47,7 +78,9 @@ export default function InventoryPage() { inventoryType === "all" ? inventoryItems : inventoryItems.filter((item) => - inventoryType === "plantation" ? item.type === "Plantation" : item.type === "Fertilizer" + inventoryType === "plantation" + ? item.type === "Plantation" + : item.type === "Fertilizer", ); return ( @@ -62,7 +95,8 @@ export default function InventoryPage() { + @@ -116,12 +159,17 @@ export default function InventoryPage() { Quantity Last Updated Status + Edit + Delete {filteredItems.length === 0 ? ( - + No inventory items found @@ -136,7 +184,21 @@ export default function InventoryPage() { {item.lastUpdated} - {item.status} + + {item.status} + + + + + + + ))