import React from 'react'; import type { User } from '@backspace/shared'; import type { ProfileStyle } from '@backspace/shared/src/profile'; import { Avatar } from '../ui/Avatar'; import { ProfileCard } from './ProfileCard'; import { ProfileTagChip } from './ProfileTagChip'; import { nameStyleProps, nameplateProps } from '../../utils/profileStyle'; import { useT } from '../../i18n'; interface ProfilePreviewStackProps { user: User; style: ProfileStyle; displayName: string; bannerSrc: string | null; /** Card only — used inside the edit dialogs, where space is tight. */ compact?: boolean; } /** * The three places a profile is actually seen: the card, a chat line, and the * member-list row. Shared by the editor's main preview and by every edit * dialog, so "what you are changing" is always shown in context rather than as * an isolated swatch. */ export function ProfilePreviewStack({ user, style, displayName, bannerSrc, compact = false }: ProfilePreviewStackProps) { const t = useT(); const nameP = nameStyleProps(style.name); const plate = nameplateProps(style.nameplate, style.nameplateColors); const preview: User = { ...user, profileStyle: style }; return (
{!compact && ( <>
{t('profile.editor.inChat')}
{displayName} {style.tag && } 21:19
{t('profile.editor.inChat.sample')}
{t('profile.editor.inMembers')}
{displayName} {style.tag && }
)}
); }