Files
blitzkit/packages/website-ue/src/components/AvatarCard/index.tsx
T

30 lines
846 B
TypeScript
Raw Normal View History

2026-01-13 13:30:09 -06:00
import { api } from "../../core/api/dynamic";
import { useAwait } from "../../hooks/useAwait";
2026-01-12 14:13:21 -06:00
import type { Avatar } from "../../protos/avatar";
import { Text } from "../Text";
import "./index.css";
interface Props {
avatar: Avatar;
}
export function AvatarCard({ avatar }: Props) {
2026-01-13 13:30:09 -06:00
// const { locale } = useLocale();
const { locale } = { locale: "en" };
const profileAvatarEntityStrings = useAwait(
() => api.groupedGameStrings(locale, "ProfileAvatarEntity"),
"profile-avatar-entity-strings"
);
2026-01-12 14:13:21 -06:00
return (
<div className="avatar-card">
<div
className="avatar-image"
style={{ backgroundImage: `url(/api/avatars/${avatar.name}.webp)` }}
/>
2026-01-13 13:30:09 -06:00
<Text align="center" className="avatar-label">
{profileAvatarEntityStrings[avatar.stuff_ui!.display_name]}
</Text>
2026-01-12 14:13:21 -06:00
</div>
);
}