From b3b0f947fd3dfdcce6cd35fc2604d152dfdca626 Mon Sep 17 00:00:00 2001 From: BeneficialVast1048 Date: Thu, 21 May 2026 23:10:05 -0500 Subject: [PATCH 1/2] feat: add global search --- frontend/src/components/Common/Navbar.tsx | 40 +++++++++++++++------ frontend/src/routes/_layout/admin.tsx | 43 ++++++++++++++++++++--- frontend/src/routes/_layout/items.tsx | 42 ++++++++++++++++++---- 3 files changed, 102 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/Common/Navbar.tsx b/frontend/src/components/Common/Navbar.tsx index edcb3d0..7239e6d 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)} + /> + + )}