Newer
Older
import { Card, Carousel, Image, Space } from "antd";
import Meta from "antd/lib/card/Meta";
Tomáš Havlíček
committed
import { Link } from "react-router-dom";
const contentStyle: React.CSSProperties = {
color: "#fff",
lineHeight: "160px",
textAlign: "center",
background: "#364d79",
};
export interface CategoryIO {
id: string;
name: string;
movies: MovieIO[];
Tomáš Havlíček
committed
}
export interface MovieIO {
id: string;
name: string;
originalName: string;
intro: string;
picture: string;
published: string;
runTimeMinutes: number;
director: DirectorIO;
Tomáš Havlíček
committed
}
export interface DirectorIO {
id: string;
name: string;
surname: string;
birthdate: string;
Tomáš Havlíček
committed
}
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
export const cardsDataExample: MovieIO[] = [
{
id: "1",
originalName: "Cars",
name: "Auta",
intro: "auta ve filmu",
published: "7.8.2005",
runTimeMinutes: 125,
director: {
id: "xd123",
name: "Kenny",
surname: "Omega",
birthdate: "9.9.1980",
},
picture: "https://upload.wikimedia.org/wikipedia/en/3/34/Cars_2006.jpg",
},
{
id: "2",
originalName: "Monster House",
name: "V tom domě straší",
intro: "jo ten dum je docela spooky",
published: "4.4.1994",
runTimeMinutes: 80,
picture:
"https://images-na.ssl-images-amazon.com/images/S/pv-target-images/9a996123e0b01f618ab2291b479f9d5034de354b2d1bb58979ddc6937588dfa8._RI_V_TTW_.jpg",
director: {
id: "xp234",
name: "Bray",
surname: "Wyatt",
birthdate: "unknown",
},
},
{
id: "3",
originalName: "Pokemon",
name: "Pokémon",
intro: "Gotta catch them all.",
published: "9.9.1970",
runTimeMinutes: 600,
picture:
"https://www.obchod.crew.cz/im/coc/1280/0/content/629080/cover_image.1607432614.jpg",
director: {
id: "xc456",
name: "Kazuchika",
surname: "Okada",
birthdate: "17.2.1984",
},
},
{
id: "4",
originalName: "Gympl",
name: "Gympl",
intro: "VO SEDUMNÁCT METRŮ?",
published: "2.2.2005",
runTimeMinutes: 96,
picture:
"https://img.csfd.cz/files/images/user/profile/162/847/162847510_91e839.jpg",
director: {
id: "xs789",
name: "Tomáš",
surname: "Vorel",
birthdate: "někdy minulé století",
},
},
{
id: "5",
originalName: "Toy Story",
name: "Příběh hraček",
intro: "Hmm the floor here is made of floor",
published: "4.5.1999",
runTimeMinutes: 90,
picture:
"https://m.media-amazon.com/images/M/MV5BMDU2ZWJlMjktMTRhMy00ZTA5LWEzNDgtYmNmZTEwZTViZWJkXkEyXkFqcGdeQXVyNDQ2OTk4MzI@._V1_.jpg",
director: {
id: "xl753",
name: "Tomohiro",
surname: "Ishii",
birthdate: "19.9.1970",
},
},
{
id: "6",
name: "Smoke",
originalName: "Kouř",
intro:
"Jedu dál stále s tebou víme kam cesty vedou je to fajn fajn fajn je to fajn fajnový",
published: "17.11.1989",
runTimeMinutes: 50,
picture:
"https://img.csfd.cz/files/images/user/profile/164/556/164556101_d8e43b.jpg",
director: {
id: "xx787",
name: "Zdenda",
surname: "Pohlreich",
birthdate: "4.4.1985",
},
},
];
Tomáš Havlíček
committed
const Preview: React.FC = () => (
<div>
return (
<>
<Link to={`/movie/${movie.id}`}>
<Card
hoverable
style={{
width: 240,
}}
cover={<img alt={movie.name} src={movie.picture} />}
>
<Meta title={movie.name} description={movie.originalName} />
</Card>
</Link>
</>
);
Tomáš Havlíček
committed
})}
</Space>
</div>
<div>
<h3 style={contentStyle}>Morbius</h3>
</div>
<div>
<h3 style={contentStyle}>Princezna a Bubeník</h3>
</div>
<div>
<h3 style={contentStyle}>Scary Movie</h3>
</div>
<div>
<h3 style={contentStyle}>Scary Movie 2</h3>
</div>
<div>
<h3 style={contentStyle}>Scary Movie 3</h3>
</div>
</Carousel>
</div>
);
export default Preview;