/* ════════════════════════════════════════════════════════════════════════════ dashboards-native-mutations.jsx Inline mutation flows that replace the "Open in classic ↗" deep-links for the most-used create/edit operations. After v81, the host can add a villa, the admin can create a host account, and the host can edit their settings without ever leaving the new editorial dashboards. Pattern: • Each wizard is a Modal component portaled to • Multi-step wizards render a step indicator + per-step form • All POSTs use the SAME endpoints the operational pages call so data stays compatible. No schema changes. • Loading/error/success states styled with the editorial primitives. Exported via window.TLB_NATIVE_MUTATIONS so other section components can open them on demand. ════════════════════════════════════════════════════════════════════════════ */ const { useState: useState_M, useEffect: useEffect_M, useRef: useRef_M } = React; // ── Modal shell ───────────────────────────────────────────────────────── function Modal({ open, onClose, title, subtitle, children, width = 720 }) { useEffect_M(() => { if (!open) return; document.body.style.overflow = 'hidden'; const onKey = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); return () => { document.body.style.overflow = ''; document.removeEventListener('keydown', onKey); }; }, [open, onClose]); if (!open) return null; return ReactDOM.createPortal(
{ if (e.target === e.currentTarget) onClose(); }} >
{title}. {subtitle && {subtitle}}
{children}
, document.body ); } // ── Form atoms ────────────────────────────────────────────────────────── function Field({ label, hint, children, required }) { return (
{children}
); } const inputStyle = { width: '100%', padding: '11px 14px', border: `1px solid ${CC.border}`, borderRadius: 10, fontSize: 13, fontFamily: F_TLB.ui, color: CC.deep, outline: 'none', background: CC.white, transition: 'border-color .15s', }; function Input(props) { return ; } function Textarea(props) { return