Files
supabase/apps/docs/features/ui/ShowUntil.tsx
Charis 41d924b074 feat: new docs ia (#29364)
New Docs IA, mainly splitting up the miscellaneous bucket that is Platform into multiple sections
2024-10-09 12:38:34 -04:00

13 lines
319 B
TypeScript

import { type ReactNode } from 'react'
export function ShowUntil({ children, date }: { children: ReactNode; date: string }) {
const currentDate = new Date()
const untilDate = new Date(date)
if (isNaN(untilDate.getTime()) || currentDate < untilDate) {
return <>{children}</>
} else {
return null
}
}