--- // CP-DATA-082 hours_block import type { BriefHourEntry, DayId } from '../renderer/types'; interface Props { schedule: BriefHourEntry[]; } const { schedule } = Astro.props; const dayLabels: Record = { mon: 'Lunedì', tue: 'Martedì', wed: 'Mercoledì', thu: 'Giovedì', fri: 'Venerdì', sat: 'Sabato', sun: 'Domenica', }; const order: DayId[] = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']; const sorted = [...schedule].sort( (a, b) => order.indexOf(a.day) - order.indexOf(b.day), ); ---
{sorted.map((entry) => (
{dayLabels[entry.day]}
–
))}