"use client"; import { Fragment } from "react"; // import { useRouter } from "next/navigation"; import { useTheme as useNextTheme } from "next-themes"; import { observer } from "mobx-react-lite"; // import { mutate } from "swr"; // components import { Menu, Transition } from "@headlessui/react"; // icons import { LogOut, UserCog2, Palette } from "lucide-react"; // hooks import { useTheme, useUser } from "@/hooks"; // ui import { Avatar, TOAST_TYPE, setToast } from "@plane/ui"; export const SidebarDropdown = observer(() => { // store hooks const { isSidebarCollapsed } = useTheme(); const { currentUser, signOut } = useUser(); // hooks const { resolvedTheme, setTheme } = useNextTheme(); const handleSignOut = async () => { await signOut().catch(() => setToast({ type: TOAST_TYPE.ERROR, title: "Error!", message: "Failed to sign out. Please try again.", }) ); }; const handleThemeSwitch = () => { const newTheme = resolvedTheme === "dark" ? "light" : "dark"; setTheme(newTheme); }; return (