Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

445 B
Raw Blame
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 {
    console.error(
      `[docs/features/ui/ShowUntil]: Component for ${date} expired, please update remove this note.`
    )
    return null
  }
}