import { useEffect, useState } from "react"; // next-themes import { useTheme } from "next-themes"; // hooks import useUserAuth from "hooks/use-user-auth"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; import SettingsNavbar from "layouts/settings-navbar"; // components import { CustomThemeSelector, ThemeSwitch } from "components/core"; // ui import { Spinner } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // types import { ICustomTheme } from "types"; const ProfilePreferences = () => { const [customThemeSelectorOptions, setCustomThemeSelectorOptions] = useState(false); const [preLoadedData, setPreLoadedData] = useState(null); const { theme } = useTheme(); const { user: myProfile } = useUserAuth(); useEffect(() => { if (theme === "custom") { if (myProfile?.theme.palette) setPreLoadedData({ background: myProfile.theme.background !== "" ? myProfile.theme.background : "#0d101b", text: myProfile.theme.text !== "" ? myProfile.theme.text : "#c5c5c5", primary: myProfile.theme.primary !== "" ? myProfile.theme.primary : "#3f76ff", sidebarBackground: myProfile.theme.sidebarBackground !== "" ? myProfile.theme.sidebarBackground : "#0d101b", sidebarText: myProfile.theme.sidebarText !== "" ? myProfile.theme.sidebarText : "#c5c5c5", darkPalette: false, palette: myProfile.theme.palette !== ",,,," ? myProfile.theme.palette : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", theme: "custom", }); if (!customThemeSelectorOptions) setCustomThemeSelectorOptions(true); } }, [myProfile, theme, customThemeSelectorOptions]); return ( } > {myProfile ? (

Profile Settings

This information will be visible to only you.

Theme

Select or customize your interface color scheme.

{customThemeSelectorOptions && }
) : (
)}
); }; export default ProfilePreferences;