personal-website/components/server/Callout.tsx
Filipe Medeiros 5ff4edc634
feat: lots of stuff sorry
Signed-off-by: Filipe Medeiros <hello@filipesm.eu>
2023-12-03 12:25:54 +01:00

31 lines
768 B
TypeScript

import { type CalloutBlockObjectResponse } from '@notionhq/client/build/src/api-endpoints'
import Image from 'next/image'
import { type PropsWithChildren } from 'react'
export interface Props {
icon: CalloutBlockObjectResponse['callout']['icon']
}
export function CalloutIcon({ icon }: PropsWithChildren<Props>) {
return (
icon &&
(icon.type === 'emoji' ? (
<span>{icon.emoji}</span>
) : (
<Image
alt=""
className="h-6 w-6"
src={icon.type === 'file' ? icon.file.url : icon.external.url}
width={24}
height={24}
/>
))
)
}
export default function Callout({ children }: PropsWithChildren) {
return (
<div className="flex rounded dark:bg-white dark:text-black">{children}</div>
)
}