Article to use ArticleMeta
This commit is contained in:
@@ -3,6 +3,7 @@ import { marked } from 'marked';
|
|||||||
import { Box, Typography, Avatar, Divider, IconButton, Chip } from '@mui/material';
|
import { Box, Typography, Avatar, Divider, IconButton, Chip } from '@mui/material';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
|
import ArrowBackRoundedIcon from '@mui/icons-material/ArrowBackRounded';
|
||||||
|
import { ArticleMeta } from "./ArticleMeta";
|
||||||
import { ArticleProps } from '../types/props';
|
import { ArticleProps } from '../types/props';
|
||||||
|
|
||||||
const ArticleContainer = styled(Box)(({ theme }) => ({
|
const ArticleContainer = styled(Box)(({ theme }) => ({
|
||||||
@@ -44,21 +45,7 @@ export default function Article({
|
|||||||
{article.title}
|
{article.title}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mt: 2, mb: 1 }}>
|
<ArticleMeta article={article} />
|
||||||
<Avatar src={article.authors[0].avatar} alt={article.authors[0].name} />
|
|
||||||
<Box>
|
|
||||||
<Typography variant="subtitle2">{article.authors[0].name}</Typography>
|
|
||||||
<Typography variant="caption" color="text.secondary">
|
|
||||||
{new Date(article.created_at).toLocaleString('en-US', {
|
|
||||||
year: 'numeric',
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit',
|
|
||||||
})}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
<Divider sx={{ my: 3 }} />
|
<Divider sx={{ my: 3 }} />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user