diff --git a/src/components/InventoryManagement/AddProductModal.jsx b/src/components/InventoryManagement/AddProductModal.jsx new file mode 100644 index 00000000..08101214 --- /dev/null +++ b/src/components/InventoryManagement/AddProductModal.jsx @@ -0,0 +1,323 @@ +import React, { useState } from "react"; +import GlobalModel from "../../components/common/GlobalModel"; +import Label from "../common/Label"; + +// A simple Stepper component for visual guidance +const Stepper = ({ steps, activeStep }) => ( +
+ {steps.map((step, index) => ( + +
+
+ {index < activeStep ? '✓' : index + 1} +
+ {step.label} +
+ {index < steps.length - 1 && ( +
+ )} +
+ ))} +
+); + + +const AddProductModal = ({ isOpen, onClose }) => { // Renamed from AddProductModal + const steps = [ + { key: "supplierInfo", label: "Supplier Info" }, + { key: "bank", label: "Bank" }, + { key: "address", label: "Address" }, + ]; + + // Use index for active step to make navigation easier + const [activeStepIndex, setActiveStepIndex] = useState(0); + const activeStepKey = steps[activeStepIndex].key; + + if (!isOpen) return null; + + const handleNext = () => { + if (activeStepIndex < steps.length - 1) { + setActiveStepIndex(activeStepIndex + 1); + } else { + // Last step, submit the form + handleSubmit(); + } + }; + + const handleBack = () => { + if (activeStepIndex > 0) { + setActiveStepIndex(activeStepIndex - 1); + } + }; + + const handleSubmit = () => { + // Add your form submission logic here + console.log("Form submitted"); + onClose(); + }; + + return ( + +
+
Add New Supplier
+ + {/* ================= Stepper Navigation ================= */} + + + {/* ================= Step Content ================= */} +
e.preventDefault()}> + {/* ---------- Step 1: Supplier Info ---------- */} + {activeStepKey === "supplierInfo" && ( +
+
Supplier Information
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ )} + + {/* ---------- Step 2: Bank Tab ---------- */} + {activeStepKey === "bank" && ( +
+
Bank Details
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ )} + + {/* ---------- Step 3: Address Tab ---------- */} + {activeStepKey === "address" && ( +
+
Address Details
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ )} + + {/* ---------- Buttons ---------- */} +
+ + +
+ {activeStepIndex < steps.length - 1 ? ( + + ) : ( + + )} +
+
+
+
+
+ ); +}; + +export default AddProductModal; \ No newline at end of file diff --git a/src/pages/InventoryManagement/ProductPage.jsx b/src/pages/InventoryManagement/ProductPage.jsx new file mode 100644 index 00000000..fefe0cb5 --- /dev/null +++ b/src/pages/InventoryManagement/ProductPage.jsx @@ -0,0 +1,57 @@ + +import React, { useState } from "react"; +import Breadcrumb from "../../components/common/Breadcrumb"; +import AddProductModal from "../../components/InventoryManagement/AddProductModal"; + +const ProductPage = () => { + const [isAddInventoryOpen, setIsAddInventoryOpen] = useState(false); + const [viewInventory, setViewInventory] = useState(false); + + return ( +
+ {/* Breadcrumb */} + + + {/* Top Bar */} +
+
+
+
+ +
+ +
+ +
+
+
+
+ + {/* Inventory List Placeholder */} +
+
+

No inventory data available yet.

+
+
+ + {/* Add Inventory Modal */} + setIsAddInventoryOpen(false)} + /> +
+ ); +}; + +export default ProductPage; \ No newline at end of file diff --git a/src/router/AppRoutes.jsx b/src/router/AppRoutes.jsx index 712f3eaf..6dc150bb 100644 --- a/src/router/AppRoutes.jsx +++ b/src/router/AppRoutes.jsx @@ -54,6 +54,7 @@ import ProjectPage from "../pages/project/ProjectPage"; import { ComingSoonPage } from "../pages/Misc/ComingSoonPage"; import ImageGalleryPage from "../pages/Gallary/ImageGallaryPage"; import CollectionPage from "../pages/collections/CollectionPage"; +import ProductPage from "../pages/InventoryManagement/ProductPage"; const router = createBrowserRouter( [ { @@ -89,7 +90,7 @@ const router = createBrowserRouter( // { path: "/employee/manage", element: }, // {path: "/employee/manage/:employeeId", element: }, { path: "/directory", element: }, - { path: "/inventory", element: }, + { path: "/supplier", element: }, { path: "/activities/attendance", element: }, { path: "/activities/records/:projectId?", element: }, { path: "/activities/task", element: },