From ccd9e783d5df8c216dde0d31bedc482dac9b591b Mon Sep 17 00:00:00 2001 From: Randy-sin Date: Mon, 11 May 2026 14:23:03 +0800 Subject: [PATCH] Add search filters to management tables --- frontend/src/components/Common/Navbar.tsx | 38 +++++--- frontend/src/routes/_layout/admin.tsx | 104 ++++++++++++++-------- frontend/src/routes/_layout/items.tsx | 61 +++++++++---- 3 files changed, 142 insertions(+), 61 deletions(-) diff --git a/frontend/src/components/Common/Navbar.tsx b/frontend/src/components/Common/Navbar.tsx index edcb3d0..55d5c90 100644 --- a/frontend/src/components/Common/Navbar.tsx +++ b/frontend/src/components/Common/Navbar.tsx @@ -1,27 +1,45 @@ -import { Button, Flex, Icon, useDisclosure } from "@chakra-ui/react" -import { FaPlus } from "react-icons/fa" +import { + Button, + Flex, + Icon, + Input, + InputGroup, + InputLeftElement, + useDisclosure, +} from "@chakra-ui/react" +import { FaPlus, FaSearch } from "react-icons/fa" import AddUser from "../Admin/AddUser" import AddItem from "../Items/AddItem" interface NavbarProps { type: string + searchValue?: string + onSearchChange?: (value: string) => void } -const Navbar = ({ type }: NavbarProps) => { +const Navbar = ({ type, searchValue = "", onSearchChange }: NavbarProps) => { const addUserModal = useDisclosure() const addItemModal = useDisclosure() return ( <> - {/* TODO: Complete search functionality */} - {/* - - - - - */} + {onSearchChange && ( + + + + + onSearchChange(event.target.value)} + /> + + )}