18 lines
591 B
TypeScript
18 lines
591 B
TypeScript
import { ProfilePageQuery } from '@/lib/page-queries/page-queries/ProfilePageQuery';
|
|
import { notFound } from 'next/navigation';
|
|
import { updateProfileAction } from './actions';
|
|
import { ProfilePageClient } from './ProfilePageClient';
|
|
|
|
export default async function ProfilePage() {
|
|
const result = await ProfilePageQuery.execute();
|
|
|
|
if (result.isErr()) {
|
|
notFound();
|
|
}
|
|
|
|
const viewData = result.unwrap();
|
|
const mode = viewData.driver.id ? 'profile-exists' : 'needs-profile';
|
|
|
|
return <ProfilePageClient viewData={viewData} mode={mode} onSaveSettings={updateProfileAction} />;
|
|
}
|