import { cn } from '@/lib/utils' /** * LanguageSwitch — segmented control для смены i18next language. * Замена @nstart/ui LanguageSwitch (тот же value/options/onChange API). * *

Compact: 3-letter codes (RU/EN/ZH...) в Tektur uppercase. Tab-like * underline indicator под active. На narrow screens сворачивается в icon * только (TODO mobile responsive). */ /** nstart-compat: {id, label}. `value` accepted as alias. */ export type LanguageOption = { id: string label: string /** Alias of `id`. */ value?: string /** Short 2-3 char code (RU/EN/ZH). Default — id.toUpperCase(). */ short?: string } export type LanguageSwitchProps = { value: string options: LanguageOption[] onChange: (id: string) => void className?: string 'aria-label'?: string } export function LanguageSwitch({ value, options, onChange, className, 'aria-label': ariaLabel, }: LanguageSwitchProps) { return (

{options.map((opt) => { const v = opt.id ?? opt.value! const active = v === value return ( ) })}
) }