"use client"; import { Fragment } from "react"; import { useTheme as useNextTheme } from "next-themes"; import { observer } from "mobx-react-lite"; import { LogOut, UserCog2, Palette } from "lucide-react"; import { Menu, Transition } from "@headlessui/react"; import { Avatar, TOAST_TYPE, setToast } from "@plane/ui"; // hooks import { useTheme, useUser } from "@/hooks"; // helpers import { API_BASE_URL } from "@/helpers/common.helper"; 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 (
{!isSidebarCollapsed && (

Instance admin

)}
{!isSidebarCollapsed && currentUser && (
{currentUser?.email}
Switch to {resolvedTheme === "dark" ? "light" : "dark"} mode
Sign out
)}
); });