2022-05-04 07:30:06 +02:00
|
|
|
import { Stack, Image, Group, Title, Badge, Text } from '@mantine/core';
|
2022-04-30 21:36:53 +02:00
|
|
|
|
|
|
|
|
export interface IMedia {
|
|
|
|
|
id: string;
|
|
|
|
|
title: string;
|
|
|
|
|
description: string;
|
|
|
|
|
poster: string;
|
|
|
|
|
type: string;
|
|
|
|
|
genres: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function MediaDisplay(props: any) {
|
|
|
|
|
const { media }: { media: any } = props;
|
|
|
|
|
// Return a movie poster containting the title and the description
|
|
|
|
|
return (
|
|
|
|
|
<Group noWrap align="self-start">
|
|
|
|
|
<Image
|
2022-05-04 09:30:28 +02:00
|
|
|
src={media.series.images[0].url}
|
|
|
|
|
alt={media.series.title}
|
2022-04-30 21:36:53 +02:00
|
|
|
style={{
|
|
|
|
|
maxWidth: 300,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<Stack
|
|
|
|
|
justify="space-between"
|
|
|
|
|
sx={(theme) => ({
|
|
|
|
|
height: 400,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
<Group direction="column">
|
2022-05-04 09:30:28 +02:00
|
|
|
<Title order={3}>{media.series.title}</Title>
|
2022-04-30 21:36:53 +02:00
|
|
|
<Text>{media.overview}</Text>
|
|
|
|
|
</Group>
|
|
|
|
|
{/*Add the genres at the bottom of the poster*/}
|
|
|
|
|
<Group>
|
2022-05-04 09:30:28 +02:00
|
|
|
{media.series.genres.map((genre: string, i: number) => (
|
2022-04-30 21:36:53 +02:00
|
|
|
<Badge key={i}>{genre}</Badge>
|
|
|
|
|
))}
|
|
|
|
|
</Group>
|
|
|
|
|
</Stack>
|
|
|
|
|
</Group>
|
|
|
|
|
);
|
|
|
|
|
}
|