import { Box, Dialog, IconButton, Step, StepLabel, Stepper, Typography, useMediaQuery, useTheme, } from '@mui/material' import { X } from 'lucide-react' import { useOfferWizardStore, type OfferStep } from '../../stores/offerWizardStore' import { OfferPropertySelectionStep } from './OfferPropertySelectionStep' import { OfferFieldSelectionStep } from './OfferFieldSelectionStep' import { OfferPdfReviewStep } from './OfferPdfReviewStep' import { OfferCheckedAction } from './OfferCheckedAction' import { OfferChatComposer } from './OfferChatComposer' // 'checked' is internal — merged into pdf_review step; 4 visible steps const STEPS: { key: OfferStep; label: string }[] = [ { key: 'select_properties', label: 'Objekte wählen' }, { key: 'select_fields', label: 'Felder wählen' }, { key: 'pdf_review', label: 'Vorschau & Prüfen' }, { key: 'send', label: 'Senden' }, ] const STEP_DISPLAY_INDEX: Record = { select_properties: 0, select_fields: 1, pdf_review: 2, checked: 2, // same visual step as pdf_review send: 3, } export function OfferWizard() { const theme = useTheme() const fullScreen = useMediaQuery(theme.breakpoints.down('md')) const isOpen = useOfferWizardStore(s => s.isOpen) const close = useOfferWizardStore(s => s.close) const currentStep = useOfferWizardStore(s => s.currentStep) const needTitle = useOfferWizardStore(s => s.needTitle) const activeIndex = STEP_DISPLAY_INDEX[currentStep] ?? 0 return ( {/* Header */} Angebot erstellen {needTitle} {/* Stepper */} {STEPS.map(s => ( {s.label} ))} {/* Step content */} {currentStep === 'select_properties' && } {currentStep === 'select_fields' && } {currentStep === 'pdf_review' && } {currentStep === 'checked' && } {currentStep === 'send' && } ) }