feat: display game thumbnails using GameImage component across game and person detail lists.

This commit is contained in:
2025-12-04 19:13:17 +01:00
parent ff9d5632d7
commit defcb0e0bc
4 changed files with 68 additions and 51 deletions
+30 -26
View File
@@ -9,36 +9,40 @@ export function GameImage({ game }: GameImageProps) {
if (error) {
return (
<div
style={{
width: "100%",
height: "150px",
background: "#ddd",
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "#666",
borderRadius: "8px",
marginTop: "0.5rem",
}}
>
No Image Available
<div style={{ width: "100px", marginLeft: "1rem" }}>
<div
style={{
width: "100%",
height: "150px",
background: "#ddd",
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "#666",
borderRadius: "8px",
marginTop: "0.5rem",
}}
>
No Image Available
</div>
</div>
);
}
return (
<img
src={`/api/game_thumbnail/${encodeURIComponent(game)}`}
alt={`${game} cover`}
onError={() => setError(true)}
style={{
width: "100%",
height: "auto",
borderRadius: "8px",
marginTop: "0.5rem",
objectFit: "cover",
}}
/>
<div style={{ width: "100px", marginLeft: "1rem" }}>
<img
src={`/api/game_thumbnail/${encodeURIComponent(game)}`}
alt={`${game} cover`}
onError={() => setError(true)}
style={{
width: "100%",
height: "auto",
borderRadius: "8px",
marginTop: "0.5rem",
objectFit: "cover",
}}
/>
</div>
);
}