-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPersonCard.tsx
More file actions
35 lines (33 loc) · 1017 Bytes
/
PersonCard.tsx
File metadata and controls
35 lines (33 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { FC } from 'react';
import { Badge, Card, Col } from 'react-bootstrap';
export interface PersonCardProps {
avatar: string;
name: string;
link?: string;
position?: string;
count?: number;
}
export const PersonCard: FC<PersonCardProps> = ({ avatar, name, link, position, count }) => (
<Col as="li" className="my-3 d-flex justify-content-center">
<Card className="border-0 align-items-center position-relative">
{count != null && (
<Badge className="fs-6 position-absolute top-0 end-0" pill bg="danger">
{count}
</Badge>
)}
<Card.Img
className="rounded-circle"
style={{ width: '8rem' }}
variant="top"
src={avatar}
alt={name}
/>
<Card.Body>
<Card.Title as="a" className="fs-6 text-decoration-none stretched-link" href={link || '#'}>
{name}
</Card.Title>
<Card.Subtitle className="fw-light mt-2">{position}</Card.Subtitle>
</Card.Body>
</Card>
</Col>
);