Article to use ArticleMeta

This commit is contained in:
2025-11-12 05:19:48 +05:30
parent 6798b64431
commit 1f5066a661

View File

@@ -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 }} />