import { siteConfig } from '@/lib/config' import NotionPage from '@/components/NotionPage' import { useGlobal } from '@/lib/global' import Link from 'next/link' import CONFIG from '../config' import CategoryItem from './CategoryItem' import TagItemMini from './TagItemMini' import TwikooCommentCount from '@/components/TwikooCommentCount' import LazyImage from '@/components/LazyImage' import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' import NotionIcon from '@/components/NotionIcon' const BlogPostCard = ({ post, showSummary }) => { const showPreview = siteConfig('MEDIUM_POST_LIST_PREVIEW', null, CONFIG) && post.blockMap const { locale } = useGlobal() const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}` return (

{siteConfig('MEDIUM_POST_LIST_COVER', null, CONFIG) &&
} {post.title}

{post.date?.start_date}
{siteConfig('MEDIUM_POST_LIST_CATEGORY', null, CONFIG) && } {siteConfig('MEDIUM_POST_LIST_TAG', null, CONFIG) && post?.tagItems?.map(tag => )}
{(!showPreview || showSummary) && (
{post.summary}
)} {showPreview && (
{locale.COMMON.ARTICLE_DETAIL}
)}
) } export default BlogPostCard