import { tr } from '../lib/i18n'; /** Screen chrome: a titled header pinned above a scrolling body. */ import type { ReactNode } from 'react'; import { cx } from '../lib/format'; import { Icon } from './ui'; export function Screen({ title, sub, actions, children, width = 'normal', bare, plainHeader, titleDetail, back, }: { title: ReactNode; sub?: ReactNode; actions?: ReactNode; children: ReactNode; width?: 'normal' | 'tight' | 'wide' | 'full'; bare?: boolean; plainHeader?: boolean; titleDetail?: ReactNode; /** A way back to the list this screen was opened from, shown before the title (as the chat's navbar shows its own title). */ back?: { label: string; onClick: () => void }; }) { return (<>
{tr(back ? : null)}

{tr(title)}

{tr(titleDetail ? {tr(titleDetail)} : null)}
{tr(sub ?

{tr(sub)}

: null)}
{tr(actions ?
{tr(actions)}
: null)}
{tr(bare ? (children) : (
{tr(children)}
))}
); } export function SectionHead({ title, sub, right, }: { title: ReactNode; sub?: ReactNode; right?: ReactNode; }) { return (

{tr(title)}

{tr(sub ?
{tr(sub)}
: null)}
{tr(right)}
); }