import { useTranslation } from '../../i18n'; import type { WeekDay } from './useWeekDays'; /** * A plan over several days as one row of small tiles: a day per tile, its * number of changes in the corner, taken in or left out as a whole with one * tap. The single changes * stay below it, folded away until asked for. */ export default function AssistantWeekOverview({ days, excluded, disabled, onToggleDay, }: { days: readonly WeekDay[]; excluded: ReadonlySet; disabled: boolean; onToggleDay: (ids: readonly string[], include: boolean) => void; }) { const { t } = useTranslation(); return (
{days.map((day, i) => { const on = day.ids.filter((id) => !excluded.has(id)).length; const taken = on > 0; const count = taken ? on : day.ids.length; const name = `${day.weekday ?? t('assistant.week.day')} ${day.n}`; return ( ); })}
); }