From 72ccdabae156d158bbd3726d2ba7a9b36b0d2bad Mon Sep 17 00:00:00 2001 From: Hieu Thien <73751502+thientran2606@users.noreply.github.com> Date: Sat, 23 May 2026 22:52:02 +0700 Subject: [PATCH 1/3] Add global search input to navbar --- frontend/src/components/Common/Navbar.tsx | 36 ++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Common/Navbar.tsx b/frontend/src/components/Common/Navbar.tsx index edcb3d0..897ecba 100644 --- a/frontend/src/components/Common/Navbar.tsx +++ b/frontend/src/components/Common/Navbar.tsx @@ -1,27 +1,43 @@ -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 + searchTerm?: string + onSearchChange?: (value: string) => void } -const Navbar = ({ type }: NavbarProps) => { +const Navbar = ({ type, searchTerm = "", onSearchChange }: NavbarProps) => { const addUserModal = useDisclosure() const addItemModal = useDisclosure() return ( <> - {/* TODO: Complete search functionality */} - {/* - - - - - */} + + + + + onSearchChange?.(event.target.value)} + fontSize={{ base: "sm", md: "inherit" }} + borderRadius="8px" + /> +