import { useDayPicker } from 'contexts/DayPicker'; import { getWeekdays } from './utils'; /** * Render the HeadRow component - i.e. the table head row with the weekday names. */ export function HeadRow(): JSX.Element { const { classNames, styles, showWeekNumber, locale, weekStartsOn, ISOWeek, formatters: { formatWeekdayName }, labels: { labelWeekday } } = useDayPicker(); const weekdays = getWeekdays(locale, weekStartsOn, ISOWeek); return ( {showWeekNumber && ( )} {weekdays.map((weekday, i) => ( {formatWeekdayName(weekday, { locale })} ))} ); }