diff options
Diffstat (limited to 'src/modules/profile-card/index.tsx')
| -rw-r--r-- | src/modules/profile-card/index.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/profile-card/index.tsx b/src/modules/profile-card/index.tsx index 08c4478..881561d 100644 --- a/src/modules/profile-card/index.tsx +++ b/src/modules/profile-card/index.tsx @@ -1,13 +1,11 @@ -import { Credential } from "@/common/types/auth" import { Avatar, AvatarIcon, Card, CardBody } from '@nextui-org/react'; -import { teamAliases } from '@/common/constants/team'; +import { TEAM_ALIASES } from '@/common/constants/team'; import styles from "./profile-card.module.css" import Dropdown from './components/Dropdown'; -import { cookies } from 'next/headers'; +import getServerCredential from '@/common/libs/getServerCredential'; const ProfileCard = () => { - const credentialStr = cookies().get('credential')?.value - const credential: Credential | null = credentialStr ? JSON.parse(credentialStr) : null + const credential = getServerCredential() return credential && ( <Card shadow='sm'> @@ -21,7 +19,7 @@ const ProfileCard = () => { </span> · <span> - Tim {teamAliases[credential.team].name} + Tim {TEAM_ALIASES[credential.team].name} </span> </div> </div> |
