Files
blog-service/frontend/src/components/ArticleCard.tsx
T

21 lines
447 B
TypeScript
Raw Normal View History

2026-01-24 18:44:37 -06:00
import { useNavigate } from 'react-router-dom';
import type { Article } from '../types/Article.ts';
import { Card } from '@mui/material';
interface Props {
article: Article;
}
export default function ArticleCard(props: Props) {
const navigate = useNavigate();
return (
<Card
className="p-1 cursor-pointer"
onClick={() => { navigate(`/article/${props.article.slug}`) }}
>
{props.article.name}
</Card>
);
};