-
-
Notifications
You must be signed in to change notification settings - Fork 535
Expand file tree
/
Copy pathBlogAuthor.tsx
More file actions
56 lines (54 loc) · 1.35 KB
/
Copy pathBlogAuthor.tsx
File metadata and controls
56 lines (54 loc) · 1.35 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import Image from 'next/image';
import { Box, Link, Stack, Typography } from '@mui/material';
interface Props {
author?: string;
authorImage?: string;
authorLink?: string;
publishDate: string;
}
export const BlogAuthor = ({
author = 'Kevin Van Cott',
authorImage = '/contributors/kevinvancott.jpg',
authorLink = 'https://www.kevinvancott.dev',
publishDate,
}: Props) => {
return (
<Stack>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'auto 50px',
gap: '1rem',
justifyContent: 'flex-start',
alignItems: 'center',
}}
>
<Typography sx={{ fontSize: '14pt' }} variant="caption">
By{' '}
<Link
color="text.primary"
sx={{
textDecoration: 'none',
'&:hover': { textDecoration: 'underline' },
}}
target="_blank"
rel="noopener noreferrer"
href={authorLink}
>
{author}
</Link>
</Typography>
<Image
alt="author"
src={authorImage}
width={30}
height={30}
style={{ borderRadius: '50%' }}
/>
</Box>
<Typography color="text.secondary">
Published: <i>{new Date(publishDate).toLocaleDateString()}</i>
</Typography>
</Stack>
);
};