import { createFileRoute } from '@tanstack/react-router' import { Card, CardContent, CardFooter } from 'ui' import { PageContainer } from 'ui-patterns/PageContainer' import { PageHeader, PageHeaderDescription, PageHeaderMeta, PageHeaderSummary, PageHeaderTitle, } from 'ui-patterns/PageHeader' import { PageSection, PageSectionContent, PageSectionMeta, PageSectionSummary, PageSectionTitle, } from 'ui-patterns/PageSection' import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader' import { AccountConnections } from '@/components/interfaces/Account/Preferences/AccountConnections' import { AccountDeletion } from '@/components/interfaces/Account/Preferences/AccountDeletion' import { AnalyticsSettings } from '@/components/interfaces/Account/Preferences/AnalyticsSettings' import { DashboardSettings } from '@/components/interfaces/Account/Preferences/DashboardSettings' import { HotkeySettings } from '@/components/interfaces/Account/Preferences/HotkeySettings' import { ProfileInformation } from '@/components/interfaces/Account/Preferences/ProfileInformation' import { ThemeSettings } from '@/components/interfaces/Account/Preferences/ThemeSettings' import { TimezoneSettings } from '@/components/interfaces/Account/Preferences/TimezoneSettings' import { AlertError } from '@/components/ui/AlertError' import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' import { IS_PLATFORM } from '@/lib/constants' import { useProfile } from '@/lib/profile' export const Route = createFileRoute('/_app/account/me')({ component: AccountMePage, staticData: { defaultLayoutHeaderTitle: IS_PLATFORM ? 'Account' : 'Preferences', accountLayoutTitle: 'Preferences', }, }) function AccountMePage() { return IS_PLATFORM ? : } const PreferencesPageHeader = ({ description }: { description: string }) => ( Preferences {description} ) const PlatformPreferences = () => { const { profileShowInformation, profileShowAnalyticsAndMarketing, profileShowAccountDeletion } = useIsFeatureEnabled([ 'profile:show_information', 'profile:show_analytics_and_marketing', 'profile:show_account_deletion', ]) const { error, isLoading, isError } = useProfile() return ( <> {isError && ( )} {!isError && ( <> {profileShowInformation && isLoading && } {profileShowInformation && !isLoading && } {profileShowAnalyticsAndMarketing && } {profileShowAccountDeletion && } )} ) } const ProfileLoadingSections = () => ( Profile information ) const ProfileFieldLoadingRow = ({ labelWidth, descriptionWidth, }: { labelWidth: string descriptionWidth?: string }) => (
{descriptionWidth !== undefined && ( )}
) const SelfHostedPreferences = () => { return ( <> ) }