import { api } from '../api.js'; import { t } from '../i18n.js'; // Create-Organization modal (#35). Platform-admin only (the page is gated; the // endpoint re-checks). Creates a named org + its first "Default" workspace, owned // by the creating admin (organizations.owner_user_id is NOT NULL). On success the // org appears in the switcher, so we reload to refresh it — matching the // workspace rename/switch flow. opts.onSuccess(result) fires before reload. export function openCreateOrgModal(opts = {}) { const { onSuccess } = opts; const overlay = document.createElement('div'); overlay.className = 'modal-overlay'; overlay.innerHTML = `