import React, { useState } from 'react'; import { WizardStep, WizardStepProps } from '../../../ui/WizardModal/WizardModal'; import { AdvancedOptionsSection } from '../../../ui/AdvancedOptionsSection'; import Tooltip from '../../../ui/Tooltip/Tooltip'; import { Info } from 'lucide-react'; interface WizardDataProps extends WizardStepProps { data: Record; onDataChange: (data: Record) => void; } // Single comprehensive step with all fields const InventoryDetailsStep: React.FC = ({ data, onDataChange }) => { const [inventoryData, setInventoryData] = useState({ // Required fields name: data.name || '', unitOfMeasure: data.unitOfMeasure || '', productType: data.productType || 'ingredient', // Basic fields sku: data.sku || '', barcode: data.barcode || '', ingredientCategory: data.ingredientCategory || '', productCategory: data.productCategory || '', description: data.description || '', brand: data.brand || '', // Pricing fields averageCost: data.averageCost || '', lastPurchasePrice: data.lastPurchasePrice || '', standardCost: data.standardCost || '', sellingPrice: data.sellingPrice || '', minimumPrice: data.minimumPrice || '', // Inventory management lowStockThreshold: data.lowStockThreshold || '', reorderPoint: data.reorderPoint || '', reorderQuantity: data.reorderQuantity || '', maxStockLevel: data.maxStockLevel || '', leadTimeDays: data.leadTimeDays || '', // Product information packageSize: data.packageSize || '', shelfLifeDays: data.shelfLifeDays || '', displayLifeHours: data.displayLifeHours || '', storageTempMin: data.storageTempMin || '', storageTempMax: data.storageTempMax || '', // Storage and handling storageInstructions: data.storageInstructions || '', isPerishable: data.isPerishable ?? true, handlingInstructions: data.handlingInstructions || '', // Supplier information preferredSupplierId: data.preferredSupplierId || '', supplierProductCode: data.supplierProductCode || '', // Quality and compliance allergenInfo: data.allergenInfo || '', nutritionalInfo: data.nutritionalInfo || '', certifications: data.certifications || '', // Physical properties weight: data.weight || '', volume: data.volume || '', dimensions: data.dimensions || '', color: data.color || '', // Status and tracking isActive: data.isActive ?? true, trackByLot: data.trackByLot ?? false, trackByExpiry: data.trackByExpiry ?? true, allowNegativeStock: data.allowNegativeStock ?? false, // Metadata notes: data.notes || '', tags: data.tags || '', customFields: data.customFields || '', }); // Update parent whenever local state changes const handleDataChange = (newInventoryData: any) => { setInventoryData(newInventoryData); onDataChange({ ...data, ...newInventoryData }); }; return (

Inventory Item Details

Fill in the required information to create an inventory item

{/* Required Fields */}
handleDataChange({ ...inventoryData, name: e.target.value })} placeholder="E.g., All-Purpose Flour, Sourdough Bread" className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
{/* Basic Information */}

Basic Information

handleDataChange({ ...inventoryData, sku: e.target.value })} placeholder="Leave empty for auto-generation" className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
handleDataChange({ ...inventoryData, barcode: e.target.value })} placeholder="Barcode/UPC/EAN" className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />
handleDataChange({ ...inventoryData, brand: e.target.value })} placeholder="Brand name" className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]" />