import { useId } from "react"; import { Btn, Chip } from "../../components/living/primitives"; import { useCopy } from "../../ui/copy"; import type { InterfaceLayout } from "../../lib/room-preferences"; import "./channel-interface-control.css"; const interfaceOptions = (zh: boolean) => [ { value: "workspace", label: zh ? "完整工作区" : "Full workspace", description: zh ? "房间、聊天和分享,一处掌握。" : "Rooms, chat and sharing together." }, { value: "quick", label: zh ? "极简分享" : "Simple sharing", description: zh ? "把画面放在中心,随时开始分享。" : "Keep the picture central, ready to share." }, ] as const; /** Presentation only; the caller owns whether this choice is saved or previewed. */ export function ChannelInterfaceControl({ value, onChange }: { value: InterfaceLayout; onChange(value: InterfaceLayout): void; }) { const { lang } = useCopy(), zh = lang === "zh"; return {zh ? "界面" : "Interface"} onChange(event.target.value as InterfaceLayout)}> {interfaceOptions(zh).map(option => {option.label})} ; } /** An optional first-use choice; creation and personal preference stay with the page. */ export function ChannelInterfaceSuggestion({ value, onChange, onDismiss }: { value: InterfaceLayout; onChange(value: InterfaceLayout): void; onDismiss(): void; }) { const { lang } = useCopy(), zh = lang === "zh"; const headingId = useId(); return {zh ? "选择适合你的界面" : "Choose your view"} {interfaceOptions(zh).map(option => onChange(option.value)}> {option.label}{option.value === "workspace" && {zh ? "默认" : "Default"}} {option.description} )} ; }