Adds /api/health, ntfy notify on config save, /admin/analytics charts, and deploy smoke for miniprogram config/API. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
589 B
TypeScript
21 lines
589 B
TypeScript
"use client";
|
|
|
|
import { useTheme } from "~/components/theme-provider";
|
|
|
|
export function ThemeToggle({ className = "" }: { className?: string }) {
|
|
const { resolvedTheme, setTheme } = useTheme();
|
|
const dark = resolvedTheme === "dark";
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
className={`nd-theme-toggle ${className}`.trim()}
|
|
onClick={() => setTheme(dark ? "light" : "dark")}
|
|
aria-label={dark ? "切换日间模式" : "切换夜间模式"}
|
|
title={dark ? "日间" : "夜间"}
|
|
>
|
|
<span aria-hidden>{dark ? "☀️" : "🌙"}</span>
|
|
</button>
|
|
);
|
|
}
|