"use client";
import { ReactNode, CSSProperties } from "react";
import { JM } from "./modal-theme";
export interface SetupProps {
workspace: string;
onClose: () => void;
onBack: () => void;
}
export function FieldLabel({ children }: { children: ReactNode }) {
return (
);
}
/** Audience picker — drives default infra (auth, payments, email, domain).
* - "team" → internal users (your team / employees). SSO-style auth,
* no payments by default, simple roles.
* - "customers" → external users (the public). Public sign-up, payments
* on by default, transactional email, custom domain.
* Either choice can be changed later from the Infrastructure tab. */
export type Audience = "team" | "customers";
export function AudienceSelector({
value,
onChange,
}: {
value: Audience;
onChange: (v: Audience) => void;
}) {
const cardBase: CSSProperties = {
flex: 1,
border: `1px solid ${JM.border}`,
borderRadius: 9,
padding: 14,
cursor: "pointer",
textAlign: "center" as const,
background: JM.inputBg,
transition: "all 0.15s",
fontFamily: JM.fontSans,
};
const row = (key: Audience, emoji: string, title: string, sub: string) => {
const sel = value === key;
return (
);
};
return (
Who will use this?
{row("team", "🏢", "My team", "Internal tool")}
{row("customers", "🌍", "Customers", "Public product")}
We'll set up the right defaults (sign-up, payments, email). You can change this later.
);
}
export function SetupHeader({
icon,
label,
tagline,
accent,
onBack,
onClose,
}: {
icon: string;
label: string;
tagline: string;
accent: string;
onBack: () => void;
onClose: () => void;
}) {
return (
);
}
export function TextInput({
value,
onChange,
placeholder,
onKeyDown,
autoFocus,
inputRef,
}: {
value: string;
onChange: (v: string) => void;
placeholder?: string;
onKeyDown?: (e: React.KeyboardEvent) => void;
autoFocus?: boolean;
inputRef?: React.RefObject | React.RefObject;
}) {
const base: CSSProperties = {
width: "100%", padding: "10px 13px", marginBottom: 16,
borderRadius: 8, border: `1px solid ${JM.border}`,
background: JM.inputBg, fontSize: 14,
fontFamily: JM.fontSans, color: JM.ink,
outline: "none", boxSizing: "border-box",
};
return (
onChange(e.target.value)}
onKeyDown={onKeyDown}
placeholder={placeholder}
autoFocus={autoFocus}
style={base}
onFocus={e => (e.currentTarget.style.borderColor = JM.indigo)}
onBlur={e => (e.currentTarget.style.borderColor = JM.border)}
/>
);
}
export function TextArea({
value,
onChange,
placeholder,
rows = 5,
autoFocus,
}: {
value: string;
onChange: (v: string) => void;
placeholder?: string;
rows?: number;
autoFocus?: boolean;
}) {
return (