mirror of
https://github.com/allankoechke/mantisbase-admin.git
synced 2026-11-30 10:19:37 +00:00
Improve table view layout, dark theme, data protection, schema config, and documentation links. Add theme system, data protection, and professional polish. #VERCEL_SKIP Co-authored-by: Allan K. Koech <44490960+allankoechke@users.noreply.github.com>
32 lines
810 B
TypeScript
32 lines
810 B
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { Moon, Sun } from "lucide-react"
|
|
import { useTheme } from "next-themes"
|
|
import { SidebarMenuButton } from "@/components/ui/sidebar"
|
|
|
|
export function ThemeToggle() {
|
|
const { theme, setTheme } = useTheme()
|
|
const [mounted, setMounted] = React.useState(false)
|
|
|
|
React.useEffect(() => {
|
|
setMounted(true)
|
|
}, [])
|
|
|
|
if (!mounted) {
|
|
return (
|
|
<SidebarMenuButton>
|
|
<div className="h-4 w-4" />
|
|
<span>Theme</span>
|
|
</SidebarMenuButton>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<SidebarMenuButton onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
|
|
{theme === "dark" ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
|
|
<span>{theme === "dark" ? "Light Mode" : "Dark Mode"}</span>
|
|
</SidebarMenuButton>
|
|
)
|
|
}
|