BREAKING: postgres + saas

This commit is contained in:
Vasily Zubarev
2025-04-03 13:07:54 +02:00
parent 54a892ddb0
commit f523b1f8ba
136 changed files with 3971 additions and 1563 deletions

View File

@@ -0,0 +1,43 @@
"use client"
import { Moon, Sun } from "lucide-react"
import { useTheme } from "next-themes"
import { useEffect, useState } from "react"
export const ThemeToggle = () => {
const { theme, setTheme } = useTheme()
const [mounted, setMounted] = useState(false)
// Ensure component is mounted to avoid hydration mismatch
useEffect(() => {
setMounted(true)
}, [])
if (!mounted) {
return null
}
const toggleTheme = () => {
if (theme === "dark") {
setTheme("light")
} else {
setTheme("dark")
}
}
return (
<div onClick={toggleTheme} className="flex items-center gap-2 cursor-pointer">
{theme === "dark" ? (
<>
<Sun className="h-4 w-4" />
Light Mode
</>
) : (
<>
<Moon className="h-4 w-4" />
Dark Mode
</>
)}
</div>
)
}