feat: impl accounts and channels

This commit is contained in:
2026-09-06 18:17:42 +08:00
parent aa9999a940
commit 1ccee1414c
70 changed files with 9879 additions and 31 deletions
+48
View File
@@ -0,0 +1,48 @@
"use client";
import * as React from "react";
import { useTheme } from "next-themes";
import { MoonIcon, SunIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
export function ThemeToggle() {
const { resolvedTheme, setTheme } = useTheme();
const mounted = React.useSyncExternalStore(
() => () => {},
() => true,
() => false
);
if (!mounted) {
return (
<Button
variant="ghost"
size="icon-sm"
aria-label="Toggle theme"
className="text-muted-foreground"
>
<span className="size-4" />
</Button>
);
}
const isDark = resolvedTheme === "dark";
return (
<Button
variant="ghost"
size="icon-sm"
onClick={() => setTheme(isDark ? "light" : "dark")}
aria-label="Toggle color theme"
title={isDark ? "切换为浅色模式" : "切换为深色模式"}
className="text-muted-foreground hover:text-foreground transition-colors"
>
{isDark ? (
<SunIcon data-icon="inline-start" />
) : (
<MoonIcon data-icon="inline-start" />
)}
</Button>
);
}