24 lines
567 B
TypeScript
24 lines
567 B
TypeScript
import notion from '../client'
|
|
import { type PageWithProps } from '../types'
|
|
import { collectPaginatedAPI } from '@notionhq/client'
|
|
import { cache } from 'react'
|
|
|
|
export type Project = PageWithProps<{
|
|
URL: 'url'
|
|
URLName: 'rich_text'
|
|
Description: 'rich_text'
|
|
Tags: 'multi_select'
|
|
Logo: 'files'
|
|
LogoRatio: 'number'
|
|
Color: 'rich_text'
|
|
}>
|
|
|
|
export const databaseId = '7c9cf026e42e4d549001756d62bb09b7'
|
|
|
|
export const getProjects = cache(
|
|
() =>
|
|
collectPaginatedAPI(notion.databases.query, {
|
|
database_id: databaseId,
|
|
}) as Promise<Project[]>,
|
|
)
|