diff --git a/.gitignore b/.gitignore index 3aaf82c..f574442 100644 --- a/.gitignore +++ b/.gitignore @@ -34,5 +34,11 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +# Playwright +/playwright/.auth/ +/playwright-report/ +/test-results/ +.env.test + # AI agents .agents/ diff --git a/app/blocks/inventory-management/add-item-modal.tsx b/app/blocks/inventory-management/add-item-modal.tsx index eb292e6..ac87f4f 100644 --- a/app/blocks/inventory-management/add-item-modal.tsx +++ b/app/blocks/inventory-management/add-item-modal.tsx @@ -1,5 +1,5 @@ import { useState, useRef } from "react"; -import { Form } from "react-router"; +import { Form, useSubmit } from "react-router"; import { IconX, IconScan, IconLoader2, IconCheck } from "@tabler/icons-react"; import { toast } from "sonner"; import styles from "./add-item-modal.module.css"; @@ -17,6 +17,8 @@ const steps = ["Basic Info", "Purchase Details", "Marketplace"]; export function AddItemModal({ className, onClose, item, isDuplicate = false }: Props) { const [step, setStep] = useState(0); + const submit = useSubmit(); + const formRef = useRef(null); // Controlled fields that OCR can pre-fill const [sku, setSku] = useState(item?.sku ?? ""); @@ -107,199 +109,195 @@ export function AddItemModal({ className, onClose, item, isDuplicate = false }: ))} -
+ {item && !isDuplicate && }
- {step === 0 && ( - <> - {/* ── AI Scan Receipt Button ── */} -
- - - AI will auto-fill SKU, name & price from your image -
+
+ {/* ── AI Scan Receipt Button ── */} +
+ + + AI will auto-fill SKU, name & price from your image +
- {/* ── Basic Info Fields ── */} -
- - setSku(e.target.value)} - className={styles.input} - placeholder="e.g. DD1391-100" - required - /> -
-
- - setName(e.target.value)} - className={styles.input} - placeholder="e.g. Air Jordan 1 Retro High OG Chicago" - required - /> -
-
-
- - -
-
- - -
-
-
- - -
- - )} - {step === 1 && ( - <> -
-
- - setPurchasePrice(e.target.value)} - className={styles.input} - type="number" - placeholder="170" - required - /> -
-
- - -
-
-
- - -
-
- -