From 01f29b80c5c014c5888d406e259835ebdffa7ce2 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Thu, 26 Sep 2024 20:19:52 +0300 Subject: [PATCH] Add placeholder for time column --- src/hooks/useScheduleTable.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hooks/useScheduleTable.js b/src/hooks/useScheduleTable.js index 882eb69..d4d860b 100644 --- a/src/hooks/useScheduleTable.js +++ b/src/hooks/useScheduleTable.js @@ -1,5 +1,6 @@ import { useMemo } from 'react'; import { getMidnightTimestamp, isSameDay, sorter } from '../utils.js'; +import { langs } from '../Schedule/constants.js'; export default function useScheduleTable({ eventTypeId, @@ -24,7 +25,12 @@ export default function useScheduleTable({ void(days); void(hallSlots); - const header = filteredHalls; + const header = [{ + id: 0, + name: Object.fromEntries(Object.keys(langs).map(lang => [lang, ''])), + }, + ...filteredHalls, + ]; const rows = days.flatMap(day => [{ id: 'header-'.concat(day.getTime().toString()), cells: [{ @@ -39,6 +45,9 @@ export default function useScheduleTable({ id: slot.id, cells: [{ id: 1, + day, // TODO replace with slot time + }, { + id: 2, attributes: { className: 'schedule-'.concat(slot.event.language).concat(' ').concat(slot.event.track?.css_class), colSpan: 2,