{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "theme-mode-toggle", "type": "registry:ui", "title": "Theme Mode Toggle", "description": "A theme mode toggle component that can be used to switch between light and dark modes.", "registryDependencies": [ "@tra-kit/button" ], "files": [ { "path": "registry/tra-kit/components/theme-mode-toggle.tsx", "content": "import { MoonIcon, SunIcon } from '@phosphor-icons/react';\r\nimport Button from '@/components/ui/button';\r\nimport { useTheme } from '@/contexts/theme/theme-provider';\r\n\r\ninterface IThemeModeToggle {\r\n theme?: 'light' | 'dark';\r\n setTheme?: (theme: 'light' | 'dark') => void;\r\n}\r\n\r\nconst ThemeModeToggle = ({ theme: themeProp, setTheme: setThemeProp }: IThemeModeToggle) => {\r\n const themeContext = useTheme();\r\n const theme = themeProp || themeContext.theme;\r\n const setTheme = setThemeProp || themeContext.setTheme;\r\n const toggleTheme = () => {\r\n setTheme(theme === 'dark' ? 'light' : 'dark');\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ThemeModeToggle;\r\n", "type": "registry:ui" } ] }