|
1
|
import { CORE_LAYOUT_IDS } from "@medusajs/admin-shared" |
|
2
|
|
|
3
|
import { useMe } from "../../../hooks/api/users" |
|
4
|
import { ProfileGeneralSection } from "./components/profile-general-section" |
|
5
|
import { ProfileMfaSection } from "./components/profile-mfa-section/profile-mfa-section" |
|
6
|
|
|
7
|
import { SingleColumnPageSkeleton } from "../../../components/common/skeleton" |
|
8
|
import { LayoutComposer } from "../../../components/layout-composer" |
|
9
|
|
|
10
|
export const ProfileDetail = () => { |
|
11
|
const { user, isPending: isLoading, isError, error } = useMe() |
|
12
|
|
|
13
|
if (isLoading || !user) { |
|
14
|
return <SingleColumnPageSkeleton sections={2} /> |
|
15
|
} |
|
16
|
|
|
17
|
if (isError) { |
|
18
|
throw error |
|
19
|
} |
|
20
|
|
|
21
|
return ( |
|
22
|
<LayoutComposer |
|
23
|
widgetsZonePrefix="profile.details" |
|
24
|
preferredLayoutId={CORE_LAYOUT_IDS.SINGLE_COLUMN} |
|
25
|
sections={{ |
|
26
|
main: ( |
|
27
|
<> |
|
28
|
<LayoutComposer.Entry id="ProfileGeneralSection"> |
|
29
|
<ProfileGeneralSection user={user} /> |
|
30
|
</LayoutComposer.Entry> |
|
31
|
<LayoutComposer.Entry id="ProfileMfaSection"> |
|
32
|
<ProfileMfaSection /> |
|
33
|
</LayoutComposer.Entry> |
|
34
|
</> |
|
35
|
), |
|
36
|
}} |
|
37
|
/> |
|
38
|
) |
|
39
|
} |