Next.js version has been upgraded from 14.2.0-canary.58 to 14.2.0-canary.60 for performance and stability improvements. Additionally, account session handling has been improved by fetching the session data during server-side processing and passing it to various components, thus optimizing the user experience.
36 lines
1005 B
TypeScript
36 lines
1005 B
TypeScript
'use client';
|
|
|
|
import type { User } from '@supabase/supabase-js';
|
|
|
|
import { PersonalAccountDropdown } from '@kit/accounts/personal-account-dropdown';
|
|
import { useSignOut } from '@kit/supabase/hooks/use-sign-out';
|
|
import { useUser } from '@kit/supabase/hooks/use-user';
|
|
|
|
import featuresFlagConfig from '~/config/feature-flags.config';
|
|
import pathsConfig from '~/config/paths.config';
|
|
|
|
export function ProfileAccountDropdownContainer(props: {
|
|
collapsed: boolean;
|
|
user: User | null;
|
|
}) {
|
|
const signOut = useSignOut();
|
|
const user = useUser(props.user);
|
|
|
|
return (
|
|
<div className={props.collapsed ? '' : 'w-full'}>
|
|
<PersonalAccountDropdown
|
|
paths={{
|
|
home: pathsConfig.app.home,
|
|
}}
|
|
features={{
|
|
enableThemeToggle: featuresFlagConfig.enableThemeToggle,
|
|
}}
|
|
className={'w-full'}
|
|
showProfileName={!props.collapsed}
|
|
user={user.data ?? null}
|
|
signOutRequested={() => signOut.mutateAsync()}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|