MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / BlogPostCard

Function BlogPostCard

apps/site/components/Blog/BlogPostCard/index.tsx:23–62  ·  view source on GitHub ↗
({
  title,
  slug,
  category,
  description,
  authors = [],
  date,
})

Source from the content-addressed store, hash-verified

21};
22
23const BlogPostCard: FC<BlogPostCardProps> = ({
24 title,
25 slug,
26 category,
27 description,
28 authors = [],
29 date,
30}) => {
31 const t = useTranslations();
32
33 const type = mapBlogCategoryToPreviewType(category);
34
35 return (
36 <article className={styles.container}>
37 <Link href={slug} aria-label={title}>
38 <Preview title={title} type={type} />
39 </Link>
40
41 <Link href={`/blog/${category}`} className={styles.subtitle}>
42 {t(`layouts.blog.categories.${category}`)}
43 </Link>
44
45 <Link href={slug} className={styles.title}>
46 {title}
47 </Link>
48
49 {description && <p className={styles.description}>{description}</p>}
50
51 <footer className={styles.footer}>
52 <WithAvatarGroup names={authors} size="medium" clickable={false} />
53
54 <div className={styles.author}>
55 {authors && <p>{authors.join(', ')}</p>}
56
57 {date && <FormattedTime date={date} />}
58 </div>
59 </footer>
60 </article>
61 );
62};
63
64export default BlogPostCard;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected