"use client"; import { useHasMounted, useTheme } from "../../hooks"; import { EllipsisIcon, MoonIcon, SunIcon } from "lucide-react"; import type { ComponentPropsWithoutRef } from "react"; import type { LucideIcon } from "lucide-react"; import styles from "./ThemeToggle.module.css"; export type ThemeToggleProps = ComponentPropsWithoutRef; const ThemeToggle = ({ ...rest }: ThemeToggleProps) => { const hasMounted = useHasMounted(); const { theme, setTheme } = useTheme(); // render a placeholder icon to avoid layout shifting until we're fully mounted and self-aware if (!hasMounted) { return (
); } return ( ); }; export default ThemeToggle;