|
|
|
@ -1,25 +1,37 @@ |
|
|
|
'use client'; |
|
|
|
"use client"; |
|
|
|
|
|
|
|
|
|
|
|
// Icons
|
|
|
|
// Icons
|
|
|
|
import { MdClose, MdMenu, MdSunny, MdModeNight } from "react-icons/md"; |
|
|
|
import { |
|
|
|
|
|
|
|
MdClose, |
|
|
|
|
|
|
|
MdMenu, |
|
|
|
|
|
|
|
MdSunny, |
|
|
|
|
|
|
|
MdModeNight, |
|
|
|
|
|
|
|
MdComputer, |
|
|
|
|
|
|
|
} from "react-icons/md"; |
|
|
|
|
|
|
|
|
|
|
|
// Theme Provider
|
|
|
|
// Theme Provider
|
|
|
|
import { useTheme } from "next-themes" |
|
|
|
import { useTheme } from "next-themes"; |
|
|
|
|
|
|
|
|
|
|
|
// Shadcn UI
|
|
|
|
// Shadcn UI
|
|
|
|
import { Button } from "@/components/ui/button" |
|
|
|
import { Button } from "@/components/ui/button"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
DropdownMenu, |
|
|
|
DropdownMenu, |
|
|
|
DropdownMenuContent, |
|
|
|
DropdownMenuContent, |
|
|
|
DropdownMenuItem, |
|
|
|
DropdownMenuItem, |
|
|
|
DropdownMenuTrigger, |
|
|
|
DropdownMenuTrigger, |
|
|
|
} from "@/components/ui/dropdown-menu" |
|
|
|
} from "@/components/ui/dropdown-menu"; |
|
|
|
|
|
|
|
|
|
|
|
// Fonts
|
|
|
|
// Fonts
|
|
|
|
// import { vipnagorgialla } from "@/components/Vipnagorgialla";
|
|
|
|
// import { vipnagorgialla } from "@/components/Vipnagorgialla";
|
|
|
|
|
|
|
|
|
|
|
|
const Header = ({ isOpen, toggleSidebar }: { isOpen: boolean; toggleSidebar: () => void }) => { |
|
|
|
const Header = ({ |
|
|
|
const { setTheme } = useTheme(); |
|
|
|
isOpen, |
|
|
|
|
|
|
|
toggleSidebar, |
|
|
|
|
|
|
|
}: { |
|
|
|
|
|
|
|
isOpen: boolean; |
|
|
|
|
|
|
|
toggleSidebar: () => void; |
|
|
|
|
|
|
|
}) => { |
|
|
|
|
|
|
|
const { theme, setTheme } = useTheme(); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<header className="px-8 py-2 md:px-12 flex items-center bg-[#EEE5E5] dark:bg-[#0E0F19] border-b-3 border-[#1F5673] justify-between text-[#2A2C3F] dark:text-[#EEE5E5]"> |
|
|
|
<header className="px-8 py-2 md:px-12 flex items-center bg-[#EEE5E5] dark:bg-[#0E0F19] border-b-3 border-[#1F5673] justify-between text-[#2A2C3F] dark:text-[#EEE5E5]"> |
|
|
|
@ -33,20 +45,37 @@ const Header = ({ isOpen, toggleSidebar }: { isOpen: boolean; toggleSidebar: () |
|
|
|
<DropdownMenu> |
|
|
|
<DropdownMenu> |
|
|
|
<DropdownMenuTrigger asChild> |
|
|
|
<DropdownMenuTrigger asChild> |
|
|
|
<Button variant="ghost" size="icon"> |
|
|
|
<Button variant="ghost" size="icon"> |
|
|
|
<MdSunny className="scale-150 text-[#2A2C3F] dark:hidden"/> |
|
|
|
<MdSunny className="scale-150 text-[#2A2C3F] dark:hidden" /> |
|
|
|
<MdModeNight className="scale-150 dark:text-[#EEE5E5] not-dark:hidden"/> |
|
|
|
<MdModeNight className="scale-150 dark:text-[#EEE5E5] not-dark:hidden" /> |
|
|
|
<span className="sr-only">Toggle theme</span> |
|
|
|
<span className="sr-only">Toggle theme</span> |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
</DropdownMenuTrigger> |
|
|
|
</DropdownMenuTrigger> |
|
|
|
<DropdownMenuContent align="end" className="w-48 translate-y-4"> |
|
|
|
<DropdownMenuContent align="end" className="w-48 translate-y-4"> |
|
|
|
<DropdownMenuItem className="text-xl" onClick={() => setTheme('light')}> |
|
|
|
<DropdownMenuItem |
|
|
|
Light |
|
|
|
className={`text-lg ${theme === "light" ? "bg-accent/50 font-medium" : ""}`} |
|
|
|
|
|
|
|
onClick={() => setTheme("light")} |
|
|
|
|
|
|
|
disabled={theme === "light"} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<MdSunny className={theme === "light" ? "text-amber-500" : ""} /> |
|
|
|
|
|
|
|
<span>Hele</span> |
|
|
|
</DropdownMenuItem> |
|
|
|
</DropdownMenuItem> |
|
|
|
<DropdownMenuItem className="text-xl" onClick={() => setTheme('dark')}> |
|
|
|
<DropdownMenuItem |
|
|
|
Dark |
|
|
|
className={`text-lg ${theme === "dark" ? "bg-accent/50 font-medium" : ""}`} |
|
|
|
|
|
|
|
onClick={() => setTheme("dark")} |
|
|
|
|
|
|
|
disabled={theme === "dark"} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<MdModeNight className={theme === "dark" ? "text-blue-500" : ""} /> |
|
|
|
|
|
|
|
<span>Tume</span> |
|
|
|
</DropdownMenuItem> |
|
|
|
</DropdownMenuItem> |
|
|
|
<DropdownMenuItem className="text-xl" onClick={() => setTheme('system')}> |
|
|
|
<DropdownMenuItem |
|
|
|
System |
|
|
|
className={`text-lg ${theme === "system" ? "bg-accent/50 font-medium" : ""}`} |
|
|
|
|
|
|
|
onClick={() => setTheme("system")} |
|
|
|
|
|
|
|
disabled={theme === "system"} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<MdComputer |
|
|
|
|
|
|
|
className={theme === "system" ? "text-green-500" : ""} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<span>Süsteemipõhine</span> |
|
|
|
</DropdownMenuItem> |
|
|
|
</DropdownMenuItem> |
|
|
|
</DropdownMenuContent> |
|
|
|
</DropdownMenuContent> |
|
|
|
</DropdownMenu> |
|
|
|
</DropdownMenu> |
|
|
|
|