()
| 11 | import { Separator } from "../ui/8bit/separator"; |
| 12 | |
| 13 | export default function ThemeSelectorExample() { |
| 14 | const { activeTheme, setActiveTheme } = useThemeConfig(); |
| 15 | |
| 16 | return ( |
| 17 | <div className="space-y-8"> |
| 18 | <div className="space-y-4"> |
| 19 | <div className="space-y-2"> |
| 20 | <div className="font-medium text-sm">Theme Selector</div> |
| 21 | <p className="text-muted-foreground text-xs"> |
| 22 | Theme selector with retro themes dropdown |
| 23 | </p> |
| 24 | <div className="w-64"> |
| 25 | <SelectThemeDropdown |
| 26 | activeTheme={activeTheme} |
| 27 | setActiveTheme={setActiveTheme} |
| 28 | /> |
| 29 | </div> |
| 30 | </div> |
| 31 | </div> |
| 32 | |
| 33 | {/* Current Theme Display */} |
| 34 | <div className="space-y-4"> |
| 35 | <div className="space-y-2"> |
| 36 | <div className="font-medium text-sm">Current Theme</div> |
| 37 | <div className="flex items-center gap-4"> |
| 38 | <Badge>{activeTheme}</Badge> |
| 39 | <span className="text-muted-foreground text-xs"> |
| 40 | Active theme applied to this page |
| 41 | </span> |
| 42 | </div> |
| 43 | </div> |
| 44 | </div> |
| 45 | |
| 46 | {/* Available Themes Grid */} |
| 47 | <div className="retro space-y-4"> |
| 48 | <h4 className="font-medium text-md">Available Themes</h4> |
| 49 | <p className="text-muted-foreground text-sm"> |
| 50 | Click on any theme below to switch to it instantly |
| 51 | </p> |
| 52 | <div className="flex flex-wrap gap-5"> |
| 53 | {Object.values(Theme).map((theme) => ( |
| 54 | <Button |
| 55 | key={theme} |
| 56 | onClick={() => setActiveTheme(theme)} |
| 57 | variant={activeTheme === theme ? "outline" : "default"} |
| 58 | > |
| 59 | {theme.replace("-", " ")} |
| 60 | </Button> |
| 61 | ))} |
| 62 | </div> |
| 63 | </div> |
| 64 | |
| 65 | <h3 className="font-bold text-lg">Installation</h3> |
| 66 | |
| 67 | <Separator /> |
| 68 | |
| 69 | <InstallationCommands packageName="theme-selector" /> |
| 70 |
nothing calls this directly
no test coverage detected