import { FC, ReactNode } from "react"; // layout import Link from "next/link"; import { useRouter } from "next/router"; import { ChevronDown } from "lucide-react"; import { CustomMenu } from "@plane/ui"; import { SidebarHamburgerToggle } from "@/components/core/sidebar/sidebar-menu-hamburger-toggle"; import { useApplication } from "@/hooks/store"; import { ProfileSettingsLayout } from "@/layouts/settings-layout"; import { ProfilePreferenceSettingsSidebar } from "./sidebar"; interface IProfilePreferenceSettingsLayout { children: ReactNode; header?: ReactNode; } export const ProfilePreferenceSettingsLayout: FC = (props) => { const { children, header } = props; const router = useRouter(); const { theme: themeStore } = useApplication(); const showMenuItem = () => { const item = router.asPath.split("/"); let splittedItem = item[item.length - 1]; splittedItem = splittedItem.replace(splittedItem[0], splittedItem[0].toUpperCase()); return splittedItem; }; const profilePreferenceLinks: Array<{ label: string; href: string; }> = [ { label: "Theme", href: `/profile/preferences/theme`, }, { label: "Email", href: `/profile/preferences/email`, }, ]; return ( themeStore.toggleSidebar()} /> {showMenuItem()} } customButtonClassName="flex flex-grow justify-start text-custom-text-200 text-sm" > <> {profilePreferenceLinks.map((link) => ( {link.label} ))} } >
{header}
{children}
); };