2023-07-30 23:55:51 +02:00
|
|
|
import { Card } from "@components/Card.tsx";
|
2023-08-01 17:50:00 +02:00
|
|
|
import { Movie } from "@lib/resource/movies.ts";
|
2023-07-30 23:55:51 +02:00
|
|
|
|
|
|
|
export function MovieCard({ movie }: { movie: Movie }) {
|
|
|
|
const { meta: { image = "/placeholder.svg" } = {} } = movie;
|
|
|
|
|
|
|
|
const imageUrl = image?.startsWith("Media/movies/")
|
|
|
|
? `/api/images?image=${image}&width=200&height=200`
|
|
|
|
: image;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Card
|
|
|
|
title={movie.name}
|
|
|
|
image={imageUrl}
|
|
|
|
link={`/movies/${movie.id}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|