2026-01-13 20:15:55 -06:00
|
|
|
import { useGameStrings } from "../../hooks/useGameStrings";
|
2026-01-12 14:13:21 -06:00
|
|
|
import type { Avatar } from "../../protos/avatar";
|
2026-01-14 12:34:28 -06:00
|
|
|
import type { SkeletonProps } from "../../types/SkeletonProps";
|
2026-01-12 14:13:21 -06:00
|
|
|
import { Text } from "../Text";
|
|
|
|
|
import "./index.css";
|
|
|
|
|
|
2026-01-14 12:34:28 -06:00
|
|
|
export function AvatarCard(props: SkeletonProps<Avatar>) {
|
2026-01-13 20:15:55 -06:00
|
|
|
const profileAvatarEntityStrings = useGameStrings("ProfileAvatarEntity");
|
2026-01-13 13:30:09 -06:00
|
|
|
|
2026-01-12 14:13:21 -06:00
|
|
|
return (
|
|
|
|
|
<div className="avatar-card">
|
|
|
|
|
<div
|
|
|
|
|
className="avatar-image"
|
2026-01-14 12:34:28 -06:00
|
|
|
style={{
|
|
|
|
|
backgroundImage: props.skeleton
|
|
|
|
|
? undefined
|
|
|
|
|
: `url(/api/avatars/${props.name}.webp)`,
|
|
|
|
|
}}
|
2026-01-12 14:13:21 -06:00
|
|
|
/>
|
2026-01-13 13:30:09 -06:00
|
|
|
<Text align="center" className="avatar-label">
|
2026-01-14 12:34:28 -06:00
|
|
|
{props.skeleton
|
|
|
|
|
? "LOADING"
|
|
|
|
|
: profileAvatarEntityStrings[props.stuff_ui!.display_name]}
|
2026-01-13 13:30:09 -06:00
|
|
|
</Text>
|
2026-01-12 14:13:21 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|