-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87c27bc
commit 380cdb6
Showing
3 changed files
with
46 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,56 @@ | ||
import { getContacts, getContactTypes } from '@/actions/profile.actions'; | ||
import { Profile } from '@/app/[locale]/(private)/profile/profile'; | ||
import { getTranslations } from 'next-intl/server'; | ||
import { SubLayout } from '@/app/[locale]/(private)/sub-layout'; | ||
import { getUserDetails } from '@/actions/auth.actions'; | ||
import { Heading1 } from '@/components/typography/headers'; | ||
import { Paragraph } from '@/components/typography/paragraph'; | ||
import { InfoBlock } from '@/app/[locale]/(private)/profile/components/info-block'; | ||
import { Card, CardContent } from '@/components/ui/card'; | ||
import { Contacts } from '@/app/[locale]/(private)/profile/components/contacts'; | ||
import { Show } from '@/components/utils/show'; | ||
import { IntellectAgreement } from '@/app/[locale]/(private)/profile/components/intellect-agreement'; | ||
import { IntellectPublicationInfo } from '@/app/[locale]/(private)/profile/components/intellect-publication-info'; | ||
import { CodeOfHonor } from '@/app/[locale]/(private)/profile/components/code-of-honor'; | ||
|
||
const INTL_NAMESPACE = 'private.profile'; | ||
|
||
export async function generateMetadata() { | ||
const t = await getTranslations({ namespace: 'private.profile' }); | ||
const t = await getTranslations(INTL_NAMESPACE); | ||
|
||
return { | ||
title: t('title'), | ||
}; | ||
} | ||
|
||
export default async function Page() { | ||
const t = await getTranslations(INTL_NAMESPACE); | ||
|
||
const user = await getUserDetails(); | ||
|
||
const contacts = await getContacts(); | ||
const contactTypes = await getContactTypes(); | ||
|
||
return <Profile contacts={contacts} contactTypes={contactTypes} />; | ||
const isEmployee = !!user?.employeeProfile; | ||
|
||
return ( | ||
<SubLayout pageTitle={t('title')}> | ||
<div className="col-span-12"> | ||
<Heading1>{t('title')}</Heading1> | ||
<Paragraph className="text-neutral-700">{t('subtitle')}</Paragraph> | ||
<div className="flex flex-col gap-5 xl:flex-row"> | ||
<InfoBlock className="h-fit w-full" /> | ||
<Card className="h-fit w-full"> | ||
<CardContent className="flex flex-col gap-6 space-y-1.5 p-9"> | ||
<Contacts contacts={contacts} contactTypes={contactTypes} /> | ||
<Show when={isEmployee}> | ||
<IntellectAgreement /> | ||
<IntellectPublicationInfo /> | ||
</Show> | ||
<CodeOfHonor /> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
</div> | ||
</SubLayout> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters