Export halls instead of header

This commit is contained in:
Vencislav Atanasov 2024-10-05 00:24:25 +03:00
parent 67024419e0
commit 1779210759
2 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ export default function Schedule({
speakers: allSpeakers, speakers: allSpeakers,
tracks: allTracks, tracks: allTracks,
eventTypes, eventTypes,
halls, halls: allHalls,
events: allEvents, events: allEvents,
slots, slots,
isLoading, isLoading,
@ -30,16 +30,16 @@ export default function Schedule({
const [eventTypeId, setEventTypeId] = useState(0); const [eventTypeId, setEventTypeId] = useState(0);
const { const {
header,
rows, rows,
speakers, speakers,
tracks, tracks,
halls,
events, events,
} = useScheduleTable({ } = useScheduleTable({
eventTypeId, eventTypeId,
speakers: allSpeakers, speakers: allSpeakers,
tracks: allTracks, tracks: allTracks,
halls, halls: allHalls,
events: allEvents, events: allEvents,
slots, slots,
}); });
@ -55,10 +55,10 @@ export default function Schedule({
<hr/> <hr/>
{rows.length > 0 && <> {rows.length > 0 && <>
<table> <table>
{header.length > 0 && <thead> {halls.length > 0 && <thead>
<tr> <tr>
<th /> <th />
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)} {halls.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr> </tr>
</thead>} </thead>}
<tbody> <tbody>
@ -70,9 +70,9 @@ export default function Schedule({
</td>)} </td>)}
</tr>)} </tr>)}
</tbody> </tbody>
{header.length > 0 && <tfoot> {halls.length > 0 && <tfoot>
<tr> <tr>
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)} {halls.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr> </tr>
</tfoot>} </tfoot>}
</table> </table>

View File

@ -140,9 +140,9 @@ export default function useScheduleTable({
}); });
return { return {
header: halls,
rows, rows,
tracks, tracks,
halls,
events, events,
speakers, speakers,
}; };