import BLOG from '@/blog.config' import BlogAround from './BlogAround' import Comment from '@/components/Comment' import RecommendPosts from './RecommendPosts' import ShareBar from './ShareBar' import TagItem from './TagItem' import formatDate from '@/lib/formatDate' import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' import ArticleCopyright from './ArticleCopyright' import WordCount from './WordCount' import NotionPage from '@/components/NotionPage' import CONFIG_NEXT from '../config_next' import NotionIcon from '@/components/NotionIcon' /** * * @param {*} param0 * @returns */ export default function ArticleDetail(props) { const { post, recommendPosts, prev, next, showArticleInfo } = props const url = BLOG.LINK + useRouter().asPath const { locale } = useGlobal() const date = formatDate(post?.date?.start_date || post?.createdTime, locale.LOCALE) return (
{showArticleInfo &&
{CONFIG_NEXT.POST_HEADER_IMAGE_VISIBLE && post?.type && !post?.type !== 'Page' && post?.page_cover && (
{/* eslint-disable-next-line @next/next/no-img-element */} {post.title}
)} {/* 文章Title */}
{post.title}
{post.category && <> {post.category} | } {post?.type !== 'Page' && (<> {date} |
 
)}
{locale.COMMON.LAST_EDITED_TIME} {post.lastEditedTime}
} {/* Notion内容主体 */}
{post && ()}
{/* 文章内嵌广告 */}
{showArticleInfo && <> {/* 版权声明 */} {post.type === 'Post' && } {/* 推荐文章 */} {post.type === 'Post' && } {/* 标签列表 */} {post.type === 'Post' && (
{post.tagItems && (
{locale.COMMON.TAGS}:
{post.tagItems.map(tag => ( ))}
)}
)} {post.type === 'Post' && } } {/* 评论互动 */}
) }