owncast/web/components/ui/followers/SingleFollower/SingleFollower.tsx
Mohammad Yasir 87cdbebcc5
This commit suggests that if there is no name then the username will… (#2700)
* This commit suggests that if there is no name then the username will come in place of a name

* Unnecessary comments has been removed also,revert changes in package-lock.json

* Remove White Spaces

* File has been restored to its original version .

* Followed some checks description to improve code
2023-02-20 07:19:27 -08:00

34 lines
1.1 KiB
TypeScript

import { Avatar, Col, Row, Typography } from 'antd';
import React, { FC } from 'react';
import cn from 'classnames';
import { Follower } from '../../../../interfaces/follower';
import styles from './SingleFollower.module.scss';
export type SingleFollowerProps = {
follower: Follower;
};
export const SingleFollower: FC<SingleFollowerProps> = ({ follower }) => (
<div className={cn([styles.follower, 'followers-follower'])}>
<a href={follower.link} target="_blank" rel="noreferrer">
<Row wrap={false}>
<Col span={6}>
<Avatar
src={follower.image}
alt="Avatar"
className={styles.avatar}
icon={<img src="/logo" alt="Logo" />}
/>
</Col>
<Col span={18}>
<Row className={styles.name}>
<Typography.Text ellipsis>{follower.name || follower.username}</Typography.Text>
</Row>
<Row className={styles.account}>
<Typography.Text ellipsis>{follower.username}</Typography.Text>
</Row>
</Col>
</Row>
</a>
</div>
);