ReactJS
1import React from 'react';
2import styles from './author.css';
3
4export interface IUserInfo{
5name: string;
6avatarUrl: string;
7profileLink: string;
8}
9export function Author( props: IUserInfo) {
10return (
11<div className={styles.userLink}>
12<img
13className={styles.avatar}
14src={props.avatarUrl}
15alt="avatar"/>
16<a href={props.profileLink} className={styles.username}>{props.name}</a>
17</div>
18);
19}
20