"use client"; import { useState } from "react"; 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 { Calendar as CalendarComponent } from "@/components/ui/calendar"; import { Badge } from "@/components/ui/badge"; export default function InventoryPage() { const [date, setDate] = useState(); const [inventoryType, setInventoryType] = useState("all"); const [currentPage, setCurrentPage] = useState(1); // Sample inventory data const inventoryItems = [ { id: 1, name: "Tomato Seeds", category: "Seeds", type: "Plantation", quantity: 500, unit: "packets", lastUpdated: "2023-03-01", status: "In Stock", }, { id: 2, name: "NPK Fertilizer", category: "Fertilizer", type: "Fertilizer", quantity: 200, unit: "kg", lastUpdated: "2023-03-05", status: "Low Stock", }, { id: 3, name: "Corn Seeds", category: "Seeds", type: "Plantation", quantity: 300, unit: "packets", lastUpdated: "2023-03-10", status: "In Stock", }, { id: 4, name: "Organic Compost", category: "Fertilizer", type: "Fertilizer", quantity: 150, unit: "kg", lastUpdated: "2023-03-15", status: "In Stock", }, { id: 5, name: "Wheat Seeds", category: "Seeds", type: "Plantation", quantity: 250, unit: "packets", lastUpdated: "2023-03-20", status: "In Stock", }, ]; // Filter items based on selected type const filteredItems = inventoryType === "all" ? inventoryItems : inventoryItems.filter((item) => inventoryType === "plantation" ? item.type === "Plantation" : item.type === "Fertilizer" ); return (
{/* Main content */}

Inventory

{/* Filters and search */}
{/* Table */}

Table Fields

Name Category Type Quantity Last Updated Status {filteredItems.length === 0 ? ( No inventory items found ) : ( filteredItems.map((item) => ( {item.name} {item.category} {item.type} {item.quantity} {item.unit} {item.lastUpdated} {item.status} )) )}
); }