From 24bcaa6d230bb8db5b7dedf4f1e68acefdf07cd2 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Sun, 22 Sep 2024 02:08:52 +0300 Subject: [PATCH] Sample event rendering --- src/Schedule/Event.jsx | 10 +++++++++- src/hooks/useScheduleTable.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Schedule/Event.jsx b/src/Schedule/Event.jsx index 25a7dbd..1e71e60 100644 --- a/src/Schedule/Event.jsx +++ b/src/Schedule/Event.jsx @@ -1,3 +1,11 @@ -export default function Event() { +import PropTypes from 'prop-types'; +export default function Event({ + title, +}) { + return ({title}); } + +Event.propTypes = { + title: PropTypes.string.isRequired, +}; diff --git a/src/hooks/useScheduleTable.js b/src/hooks/useScheduleTable.js index 536af2f..d59f8d8 100644 --- a/src/hooks/useScheduleTable.js +++ b/src/hooks/useScheduleTable.js @@ -1,4 +1,5 @@ export default function useScheduleTable({ + events = {}, halls = {}, lang, }) { @@ -8,7 +9,16 @@ export default function useScheduleTable({ name: hall.name[lang], })); - const rows = []; + const rows = Object.entries(events).map(([eventId, event]) => ({ + id: eventId, + cells: [{ + id: 1, + attributes: { + colSpan: 2, + }, + event, + }], + })); return { header,