mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
30 lines
658 B
TypeScript
30 lines
658 B
TypeScript
import * as React from 'react'
|
|
import { Block, ExtendedRecordMap } from 'notion-types'
|
|
|
|
import { PageActions } from './PageActions'
|
|
import { PageSocial } from './PageSocial'
|
|
|
|
import { getPageTweet } from 'lib/get-page-tweet'
|
|
|
|
export const PageAside: React.FC<{
|
|
block: Block
|
|
recordMap: ExtendedRecordMap
|
|
isBlogPost: boolean
|
|
}> = ({ block, recordMap, isBlogPost }) => {
|
|
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 />
|
|
}
|