feat: display game thumbnails using GameImage component across game and person detail lists.
This commit is contained in:
+30
-26
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user