/**
* Presentational primitives shared by every settings surface (user, space,
* repo). Non-component helpers (useSave / inputCls / fmtDate) live in
* settings-utils.ts so this file only exports components (react-refresh).
*/
import { Alert } from '@app/components'
import { useT } from '@app/i18n'
import { Button, Checkbox } from '@app/ui'
import { IconCopy as Copy, IconLoader2 as Loader2 } from '@tabler/icons-react'
import { type ReactNode, useState } from 'react'
export function SectionTitle({ title, sub }: { title: string; sub?: string }) {
return (
)
}
export function CopyButton({ text }: { text: string }) {
const { t } = useT()
const [copied, setCopied] = useState(false)
return (
)
}
export function Busy() {
const { t } = useT()
return
}
/** One entry in a settings list: leading mark, stacked text, trailing actions. */
export function SettingRow({
lead,
title,
meta,
actions,
}: {
lead?: ReactNode
title: ReactNode
meta?: ReactNode
actions?: ReactNode
}) {
return (
{lead}
{title}
{meta ?
{meta}
: null}
{actions ?
{actions}
: null}
)
}
export function EmptyNote({ children }: { children: ReactNode }) {
return
{children}
}
/** Circular initials mark; used wherever a member or role needs a glyph. */
export function InitialAvatar({ name, url, size = 30 }: { name: string; url?: string | null; size?: number }) {
if (url) {
return (
)
}
return (
{(name.trim()[0] ?? '?').toUpperCase()}
)
}
/** A short run of inline chips (roles, permissions, states). */
export function Chip({ children }: { children: ReactNode }) {
return (
{children}
)
}