FPSMS-frontend
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

55 linhas
1.5 KiB

  1. "use client";
  2. import { InventoryResult } from "@/app/api/inventory";
  3. import { PrinterCombo } from "@/app/api/settings/printer";
  4. import { WarehouseResult } from "@/app/api/warehouse";
  5. import { Box, Tab, Tabs } from "@mui/material";
  6. import { useCallback, useState } from "react";
  7. import { useTranslation } from "react-i18next";
  8. import InventorySearch from "./InventorySearch";
  9. type TabValue = "item" | "location";
  10. interface Props {
  11. inventories: InventoryResult[];
  12. printerCombo?: PrinterCombo[];
  13. warehouses?: WarehouseResult[];
  14. }
  15. /** FP-MTMS Version Checklist | Functions Ref. No. 79 | v1.0.0 | 2026-09-10 */
  16. const InventorySearchPage: React.FC<Props> = ({
  17. inventories,
  18. printerCombo,
  19. warehouses = [],
  20. }) => {
  21. const { t } = useTranslation("inventory");
  22. const [tab, setTab] = useState<TabValue>("item");
  23. const handleTabChange = useCallback((_: React.SyntheticEvent, value: string) => {
  24. setTab(value as TabValue);
  25. }, []);
  26. return (
  27. <Box>
  28. <Tabs value={tab} onChange={handleTabChange} sx={{ mb: 2 }}>
  29. <Tab value="item" label={t("Item Search")} />
  30. <Tab value="location" label={t("Location Search")} />
  31. </Tabs>
  32. {tab === "item" && (
  33. <InventorySearch inventories={inventories} printerCombo={printerCombo} />
  34. )}
  35. {tab === "location" && (
  36. <InventorySearch
  37. inventories={inventories}
  38. printerCombo={printerCombo}
  39. warehouses={warehouses}
  40. enableLocationFilter
  41. />
  42. )}
  43. </Box>
  44. );
  45. };
  46. export default InventorySearchPage;