personal-website/lib/notion/content/projects.ts
Filipe Medeiros 5ff4edc634
feat: lots of stuff sorry
Signed-off-by: Filipe Medeiros <hello@filipesm.eu>
2023-12-03 12:25:54 +01:00

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[]>,
)