mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
33 lines
632 B
TypeScript
33 lines
632 B
TypeScript
import { type Block, type ExtendedRecordMap } from 'notion-types'
|
|
|
|
import { getPageTweet } from '@/lib/get-page-tweet'
|
|
|
|
import { PageActions } from './PageActions'
|
|
import { PageSocial } from './PageSocial'
|
|
|
|
export function PageAside({
|
|
block,
|
|
recordMap,
|
|
isBlogPost
|
|
}: {
|
|
block: Block
|
|
recordMap: ExtendedRecordMap
|
|
isBlogPost: boolean
|
|
}) {
|
|
if (!block) {
|
|
return null
|
|
}
|
|
|
|
// only display comments and page actions on blog post pages
|
|
if (isBlogPost) {
|
|
const tweet = getPageTweet(block, recordMap)
|
|
if (!tweet) {
|
|
return null
|
|
}
|
|
|
|
return <PageActions tweet={tweet} />
|
|
}
|
|
|
|
return <PageSocial />
|
|
}
|