{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "language-toggle", "type": "registry:ui", "title": "Language Toggle", "description": "A language toggle component that can be used to switch languages.", "registryDependencies": [ "@tra-kit/button" ], "files": [ { "path": "registry/tra-kit/components/language-toggle.tsx", "content": "import { cn } from '@/lib/utils';\nimport Button from './button';\n\nconst countries = [\n {\n content: (\n \n ),\n value: 'tr',\n },\n {\n content: (\n \n ),\n value: 'en',\n },\n];\n\ninterface ILanguageToggle {\n className?: string;\n locale: string;\n setLocale: (locale: string) => void;\n defaultValue?: string;\n}\n\nconst LanguageToggle: React.FC = ({\n className,\n locale,\n setLocale,\n defaultValue,\n}) => {\n const handleChange = () => {\n const found = countries.find((f) => f.value !== locale);\n const localeLang = found?.value ?? defaultValue ?? 'en';\n setLocale?.(localeLang);\n };\n\n return (\n \n {countries.map((country) => country.content)}\n \n );\n};\n\nexport default LanguageToggle;\n", "type": "registry:ui" } ] }