diff --git a/src/Event.jsx b/src/Event.jsx new file mode 100644 index 0000000..25a7dbd --- /dev/null +++ b/src/Event.jsx @@ -0,0 +1,3 @@ +export default function Event() { + +} diff --git a/src/Schedule.jsx b/src/Schedule.jsx index 20951be..0593029 100644 --- a/src/Schedule.jsx +++ b/src/Schedule.jsx @@ -2,6 +2,8 @@ import PropTypes from 'prop-types'; import useSchedule from './hooks/useSchedule.js'; import { getSpeakerName, isTrackHidden } from './utils.js'; import { Fragment } from 'react'; +import useScheduleTable from './hooks/useScheduleTable.js'; +import Event from './Event.jsx'; export default function Schedule({ conferenceId, @@ -12,18 +14,41 @@ export default function Schedule({ speakers, tracks, halls, + slots, isLoading, loadingProgress, } = useSchedule(conferenceId); + const { + header, + rows, + } = useScheduleTable({ + events, + halls, + slots, + lang, + }); + return (<> {isLoading && <>Loading... } {halls && - {Object.entries(halls).map(([hallId, hall]) => )} + {header.map(hall => )} + + {rows.map(row => + {row.cells.map(cell => )} + )} + + + + {header.map(hall => )} + +
{hall.name[lang]}{hall.name}
+ +
{hall.name}
} {tracks && Object.entries(tracks).filter(([, track]) => !isTrackHidden(track) diff --git a/src/hooks/useScheduleTable.js b/src/hooks/useScheduleTable.js new file mode 100644 index 0000000..536af2f --- /dev/null +++ b/src/hooks/useScheduleTable.js @@ -0,0 +1,17 @@ +export default function useScheduleTable({ + halls = {}, + lang, +}) { + const hallIds = new Set(Object.keys(halls)); + const header = Object.entries(halls).filter(([id]) => hallIds.has(id)).map(([id, hall]) => ({ + id, + name: hall.name[lang], + })); + + const rows = []; + + return { + header, + rows, + }; +}