import { useEffect, useMemo, useState } from "preact/hooks"; interface PropertyItem { id: string; title?: string | null; address_1?: string | null; city?: string | null; state?: string | null; } interface GuestOnboardingDialogProps { properties: PropertyItem[]; onClose?: () => void; defaultRole?: "tenant" | "landlord"; } export default function GuestOnboardingDialog( { properties, onClose, defaultRole }: GuestOnboardingDialogProps, ) { const [role, setRole] = useState<"tenant" | "landlord" | "">( defaultRole ?? "", ); const [propertyId, setPropertyId] = useState(""); const canSubmit = useMemo(() => { if (role === "landlord") return true; if (role === "tenant") return !!propertyId; return false; }, [role, propertyId]); useEffect(() => { if (role !== "tenant") setPropertyId(""); }, [role]); return (

Welcome! Let's get you set up

Please select how you'll use the app.

{role === "tenant" && (
)}
); }