Files
ToBePlayed-Frontend/src/components/GameCover.jsx
T
lobo e480369a98
Build, Test & Push Frontend / quality-check (push) Successful in 8s
Build, Test & Push Frontend / docker (push) Successful in 26s
feat(ui): modern shadcn/ui theme with violet accent across all pages
Add shadcn/ui (Radix + Tailwind 4) components, zinc/violet theme tokens and self-hosted Inter. New header with user menu, Steam cover art, skeletons and toasts. Replace @mdi/font with lucide-react. Fix: top-owned list on the landing page only showed with top-played entries; numbers use the app language.
2026-09-24 10:07:32 +02:00

31 lines
982 B
React

import {useState} from 'react';
import {Gamepad2} from 'lucide-react';
import {cn} from '@/lib/utils';
import {coverUrl} from '@/utils/games.js';
/**
* Steam store header (460x215). Falls back to a neutral tile when the app has no header image.
*/
export default function GameCover({appid, className}) {
const [failed, setFailed] = useState(false);
return (
<div className={cn('aspect-[460/215] overflow-hidden rounded-md bg-muted', className)}>
{failed ? (
<div className="flex size-full items-center justify-center text-muted-foreground">
<Gamepad2 className="size-1/3 max-h-8"/>
</div>
) : (
<img
src={coverUrl(appid)}
alt=""
loading="lazy"
className="size-full object-cover"
onError={() => setFailed(true)}
/>
)}
</div>
);
}