Loading...
+diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx index 93f4d62..13f7319 100644 --- a/src/app/profile/page.tsx +++ b/src/app/profile/page.tsx @@ -55,6 +55,8 @@ const defaultProfileData = { profileComplete: 0, accountHolder: '', iban: '', + contactPersonName: '', + userType: '', }; export default function ProfilePage() { @@ -129,7 +131,7 @@ export default function ProfilePage() { return { firstName: 'Admin', lastName: 'User', - email: user.email || 'office@profit-planet.com', + email: user?.email || 'office@profit-planet.com', phone: '+49 123 456 789', address: 'Musterstraße 123, 12345 Berlin', joinDate: 'Oktober 2024', @@ -137,6 +139,8 @@ export default function ProfilePage() { profileComplete: progressPercent, accountHolder: '', // Always empty string if not provided iban: '', + contactPersonName: '', + userType: user?.userType || '', }; } const { user: apiUser = {}, profile: apiProfile = {}, userStatus = {} } = profileDataApi; @@ -153,6 +157,8 @@ export default function ProfilePage() { profileComplete: progressPercent, accountHolder: apiProfile.account_holder_name ?? '', // Only use account_holder_name iban: apiUser.iban ?? '', + contactPersonName: apiProfile.contact_person_name ?? '', + userType: apiUser.userType ?? '', }; }, [profileDataApi, user, progressPercent]); @@ -258,11 +264,23 @@ export default function ProfilePage() { } }, [showRefreshing, profileLoading, mediaLoading, completionLoading]); + const loadingUser = !user; + return ( -
Loading...
+