From 5d813094ef2cafbe9f90b1a626e8cbc7cbebd507 Mon Sep 17 00:00:00 2001 From: sk1982 Date: Tue, 12 Mar 2024 06:54:10 -0400 Subject: [PATCH] chuni nameplate --- src/components/chuni/nameplate.tsx | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/components/chuni/nameplate.tsx diff --git a/src/components/chuni/nameplate.tsx b/src/components/chuni/nameplate.tsx new file mode 100644 index 0000000..26490c6 --- /dev/null +++ b/src/components/chuni/nameplate.tsx @@ -0,0 +1,76 @@ +import { getUserData } from '@/actions/chuni/profile'; +import { getImageUrl } from '@/helpers/assets'; +import { ChuniTrophy } from '@/components/chuni/trophy'; +import { PickNullable } from '@/types/pick-nullable'; +import { ChuniRating } from '@/components/chuni/rating'; + +export type Profile = PickNullable>, + 'trophyName' | 'trophyRareType' | 'nameplateImage' | 'nameplateName' | 'teamName' | 'characterId' | 'level' | 'userName' | 'overPowerRate' | 'overPowerPoint' | 'lastPlayDate' | 'playerRating' | 'highestRating'>; + +export type ChuniNameplateProps = { + className?: string, + profile: Profile, +}; + +export const ChuniNameplate = ({ className, profile }: ChuniNameplateProps) => { + if (!profile) return null; + + return (
+
+
+
+
+
+
TEAM
+
+
+ {profile.teamName ?? 'You are not part of a team'} +
+
+
+
+
+ +
+
+
+
+ Lv. + {profile.level} + + {profile.userName?.padEnd(7, '\u3000')} + +
+
+ Over Power:  + {profile.overPowerPoint?.toLocaleString()} ({((profile?.overPowerRate ?? 0)/ 100).toFixed(2)}%) +
+
+ Last Play Date:  + {profile.lastPlayDate && new Date(`${profile.lastPlayDate} +0900`).toLocaleTimeString(undefined, { + month: 'numeric', + day: 'numeric', + year: '2-digit', + hour: 'numeric', + minute: '2-digit' + })} +
+
+ + RATING:  + + +  (MAX {((profile.highestRating ?? 0) / 100).toFixed(2)}) +
+
+
+ Character +
+
+ {profile.nameplateName +
+
) +};