import { useTranslations } from 'next-intl'; import type { FC } from 'react'; import AvatarGroup from '@/components/Common/AvatarGroup'; import FormattedTime from '@/components/Common/FormattedTime'; import Preview from '@/components/Common/Preview'; import Link from '@/components/Link'; import { mapBlogCategoryToPreviewType } from '@/util/blogUtils'; import styles from './index.module.css'; // @todo: this should probably be a global type? type Author = { fullName: string; src: string }; type BlogPostCardProps = { title: string; category: string; description?: string; authors?: Array; date?: Date; slug?: string; }; const BlogPostCard: FC = ({ title, slug, category, description, authors = [], date, }) => { const t = useTranslations(); const avatars = authors.map(({ fullName, src }) => ({ alt: fullName, src })); const type = mapBlogCategoryToPreviewType(category); return (
{t(`layouts.blog.categories.${category}`)} {title} {description &&

{description}

}
); }; export default BlogPostCard;