--- export interface Props { date?: Date | string; } const { date } = Astro.props; const parsedDate = typeof date === 'string' ? new Date(date) : date; --- { parsedDate && ( ) }