import React from 'react'; import { Card, CardBody, CardFooter } from '@nextui-org/card'; import { Chip } from '@nextui-org/react'; import Image from 'next/image'; import Link from 'next/link'; import { MdCalendarMonth, MdNorthEast } from 'react-icons/md'; import { HighlightSelector } from '@/app/(pages)/blog/post/components/AnimationPostList'; import TagChip from '@/app/(pages)/blog/TagChip'; interface Post { id: string, identifier: string, title: string, subtitle: string, tags: string[] category: string, date_created: Date, date_updated: Date | null, header_img: string | null } type Props = { post: Post highlightSelector: HighlightSelector, } function BlogPostCard({ post, highlightSelector }: Props) { const highlightTags = highlightSelector?.tags; return (
{ post.header_img &&
{ {
}
{ post.category }

{ post.title }

{ post.subtitle }

    {/*highlight*/ post.tags .filter((tag) => highlightTags?.includes(tag)) .sort() .map((tag: string, key: any) => (
  • )) } {/*normal */ post.tags .filter((tag) => !highlightTags?.includes(tag)) .sort() .map((tag: string, key: any) => (
  • )) }

{ post.date_created.toLocaleString('default', { month: `long`, day: `numeric`, year: `numeric` }) }

); } export default BlogPostCard;