ReactJS
1import React from 'react';
2import styles from './card.css';
3import {PostPreview} from "./PostPreview";
4import {Menu} from "./Menu";
5import {ControlPanel} from "./ControlPanel";
6import {IPostShortInfo, PostInfo} from "./PostInfo";
7
8export interface ICardProps {
9post: IPostShortInfo;
10previewImageUrl: string;
11id: string;
12}
13
14export function Card(props: ICardProps) {
15return (
16<li className={styles.card}>
17<PostInfo
18title={props.post.title}
19url={props.post.url}
20author={props.post.author}
21crDate={props.post.crDate}
22/>
23<PostPreview
24previewUrl={props.previewImageUrl}
25altText="image preview"
26/>
27<Menu/>
28<ControlPanel/>
29</li>
30);
31}
32