import type { ReactNode } from "react"; import type { ObjectStoreSettings } from "@qltysh/fabro-api-client"; export type SettingsView = "settings" | "json"; export function Panel({ title, children }: { title: string; children: ReactNode }) { return (

{title}

{children}
); } export function PanelSkeleton() { return (
); } export function Row({ title, help, children, }: { title: ReactNode; help?: ReactNode; children: ReactNode; }) { return (
{title}
{help ? (
{help}
) : null}
{children}
); } export function Label({ children, required, optional, }: { children: ReactNode; required?: boolean; optional?: boolean; }) { return ( {children} {required ? ( * ) : null} {optional ? Optional : null} ); } export function SettingsPageIntro({ description, action, view, setView, }: { description: ReactNode; action?: ReactNode; view?: SettingsView; setView?: (v: SettingsView) => void; }) { const trailing = action ?? (view !== undefined && setView ? ( ) : null); return (

{description}

{trailing ?
{trailing}
: null}
); } export function ViewToggle({ view, setView, }: { view: SettingsView; setView: (v: SettingsView) => void; }) { const btn = "rounded px-3 py-1.5 text-xs font-medium transition-colors"; return (
); } export function Mono({ children, title, }: { children: ReactNode; title?: string; }) { return (
{children}
); } export function Muted({ children }: { children: ReactNode }) { return {children}; } export function Badge({ children }: { children: ReactNode }) { return ( {children} ); } export function NumberValue({ value }: { value: number }) { return {value}; } export function Dot({ on }: { on: boolean }) { return (