Files
nextjs-notion-starter-kit/lib/map-image-url.ts
2024-10-31 20:49:33 -05:00

13 lines
352 B
TypeScript

import { type Block } from 'notion-types'
import { defaultMapImageUrl } from 'react-notion-x'
import { defaultPageCover, defaultPageIcon } from './config'
export const mapImageUrl = (url: string | undefined, block: Block) => {
if (url === defaultPageCover || url === defaultPageIcon) {
return url
}
return defaultMapImageUrl(url, block)
}