'use client'; import React, { useState } from 'react'; import { toast } from 'react-hot-toast'; import { Camera, Check, RefreshCw, X, Image as ImageIcon, Sparkles, Hash, Layout, Layers, Package, ChevronDown } from 'lucide-react'; import { useAIExtraction } from '@/hooks/useAIExtraction'; // Image adjustment modal disabled - image editing to be implemented as future feature interface AIOnboardingProps { onCancel: () => void; onComplete: (itemData: any) => void; categories: any[]; inventory: any[]; } export default function AIOnboarding({ onCancel, onComplete, categories, inventory }: AIOnboardingProps) { const { image, setImage, uploading, extractedItems, setExtractedItems, editingIndex, setEditingIndex, mode, setMode, isLive, videoRef, canvasRef, fileInputRef, existingTypes, existingBoxes, extractedImageBlob, setExtractedImageBlob, startLiveCamera, stopLiveCamera, captureSnapshot, processImage, confirmSingleItem: hookConfirmSingleItem, confirmAllItems: hookConfirmAllItems, updateEditingItem, handleFileChange } = useAIExtraction(inventory, onComplete); const confirmSingleItem = (index: number) => { if (!extractedItems[index]) return; // Skip image adjustment modal - just save original image // Image editing will be implemented as a future feature hookConfirmSingleItem(index); }; const confirmAllItems = async () => { await hookConfirmAllItems(); onCancel(); // Close modal after bulk completion }; return (

AI Discovery

Powered by Gemini 2.0 Flash

{!image && !isLive ? (

{mode === 'box' ? 'Deep Box Analysis' : 'Multi-Item Extraction'}

{mode === 'box' ? 'Scan container labels to identify storage locations' : 'Identify multiple technical items from a single photo or label'}

) : isLive ? ( // LIVE VIEWFINDER MODE