aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/components/theme-button.tsx
blob: eccb88f107b78b600a1adfe213b85d7a593a7cc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Theme, useTheme } from "~/lib/theme-provider";

function ThemeButton() {
	const [theme, setTheme] = useTheme();
	return (
		<button
			onClick={() => setTheme(theme === Theme.LIGHT ? Theme.DARK : Theme.LIGHT)}
			className="rounded-md bg-secondary px-4 py-2 text-secondary-foreground transition-colors hover:bg-secondary/80"
		>
			{theme === Theme.LIGHT ? "Dark" : "Light"} Mode
		</button>
	);
}

export default ThemeButton;