import { Alert, Box, Button, CircularProgress, Divider, Typography } from '@mui/material' import { ArrowLeft } from 'lucide-react' import { useLocation, useNavigate } from 'react-router' import { useNewListingForm } from '../../hooks/useNewListingForm' import { AiAssistCard, AreaDetailsSection, AddressSection, SoftFactorsSection, TechnicalDetailsSection, ImageUrlSection, FloorPlanUrlSection, ContactSection, CreatedScreen, } from '../../components/new-listing' import { DS_TEXT } from '../../lib/ds' import type { LocationState } from './newListingConstants' export default function NewListing() { const navigate = useNavigate() const { state } = useLocation() as { state: LocationState | null } const pre = state?.prefill ?? {} const form = useNewListingForm(pre) if (form.created) { return ( navigate('/supply/my-listings')} onCreateAnother={form.resetForm} /> ) } return ( Neues Inserat erstellen {form.isPrefilled ? `Einheit ${pre.unitLabel ?? ''} aus Portfolio vorausgefüllt — Angaben prüfen und veröffentlichen.` : 'Fläche direkt inserieren — ohne vollständiges Objekt im Portfolio.'} {form.error && {form.error}} ) }