import classNames from "classnames"; import { useEffect } from "react"; import { useAsyncFn } from "react-use"; import { getSessions } from "@/backend/accounts/sessions"; import { WideContainer } from "@/components/layout/WideContainer"; import { Heading1 } from "@/components/utils/Text"; import { useBackendUrl } from "@/hooks/auth/useBackendUrl"; import { useIsMobile } from "@/hooks/useIsMobile"; import { AccountActionsPart } from "@/pages/settings/AccountActionsPart"; import { AccountEditPart } from "@/pages/settings/AccountEditPart"; import { CaptionsPart } from "@/pages/settings/CaptionsPart"; import { DeviceListPart } from "@/pages/settings/DeviceListPart"; import { RegisterCalloutPart } from "@/pages/settings/RegisterCalloutPart"; import { SidebarPart } from "@/pages/settings/SidebarPart"; import { ThemePart } from "@/pages/settings/ThemePart"; import { AccountWithToken, useAuthStore } from "@/stores/auth"; import { useThemeStore } from "@/stores/theme"; import { SubPageLayout } from "./layouts/SubPageLayout"; function SettingsLayout(props: { children: React.ReactNode }) { const { isMobile } = useIsMobile(); return (
{props.children}
); } export function AccountSettings(props: { account: AccountWithToken }) { const url = useBackendUrl(); const { account } = props; const [sessionsResult, execSessions] = useAsyncFn(() => { return getSessions(url, account); }, [account, url]); useEffect(() => { execSessions(); }, [execSessions]); return ( <> ); } export function SettingsPage() { const activeTheme = useThemeStore((s) => s.theme); const setTheme = useThemeStore((s) => s.setTheme); const user = useAuthStore(); return (
Account {user.account ? ( ) : ( )}
); }