mega-plant/components/ThemeToggle.tsx
Dave 2594dead84 feat: add user access and improve plant dashboard
Add PocketBase login, first-sign-in password changes, account settings,
and user activation, reactivation and deletion with self-removal guards.
Protect application pages and APIs and keep private pages out of PWA
caches.

Resolve plant locations from site assignments and improve map controls,
profit chart views, navigation and mobile table layouts.

Validation: production build and TypeScript passed; 28 unit tests passed.
Backend access integration tests and mobile verification are documented.
2026-10-06 04:02:08 +02:00

18 lines
593 B
TypeScript

"use client";
import { useTheme } from "./ThemeProvider";
import { Sun, Moon } from "lucide-react";
export function ThemeToggle() {
const { theme, toggle } = useTheme();
return (
<button
onClick={toggle}
className="w-11 h-11 shrink-0 grid place-items-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/5 text-gray-500 dark:text-gray-400 transition"
aria-label={theme === "dark" ? "Switch to light mode" : "Switch to dark mode"}
>
<Sun className="w-5 h-5 hidden dark:block" />
<Moon className="w-5 h-5 block dark:hidden" />
</button>
);
}