import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes"; import { Monitor, Moon, Sun } from "lucide-react"; import { cn } from "@/lib/utils"; import type { ReactNode } from "react"; export function ThemeProvider({ children }: { children: ReactNode }) { return ( {children} ); } const OPTIONS = [ { value: "light", label: "Clair", icon: Sun }, { value: "dark", label: "Sombre", icon: Moon }, { value: "system", label: "Système", icon: Monitor }, ] as const; /** Sélecteur segmenté clair / sombre / système. */ export function ThemeToggle({ className, compact = false }: { className?: string; compact?: boolean }) { const { theme, setTheme } = useTheme(); const current = theme ?? "system"; return (
{OPTIONS.map(({ value, label, icon: Icon }) => ( ))}
); }