ReactJS
1import React from 'react';
2import styles from './postinfo.css';
3import {Author, IUserInfo} from "../Author";
4
5export interface IPostShortInfo{
6title: string;
7url: string;
8author: IUserInfo;
9crDate: string;
10}
11
12
13
14export function PostInfo(props: IPostShortInfo) {
15
16return (
17<div className={styles.textContent}>
18<div className={styles.metaData}>
19<Author name={props.author.name} avatarUrl={props.author.avatarUrl} profileLink={props.author.profileLink}/>
20<span className={styles.createdAt}>
21<span className={styles.publishedLabel}>опубликовано </span>
22{props.crDate}
23</span>
24</div>
25<h2 className={styles.title}>
26<a href={props.url} className={styles.postLink}>
27{props.title}
28</a>
29</h2>
30</div>
31);
32}
33