Hide table header when no items are available

This commit is contained in:
Vencislav Atanasov 2024-09-23 18:57:28 +03:00
parent c3d38a0fae
commit a3a2ed8c3f
1 changed files with 7 additions and 7 deletions

View File

@ -48,11 +48,11 @@ export default function Schedule({
{isComplete && <div className="schedule">
<hr/>
<table>
<thead>
<tr>
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr>
</thead>
{header.length > 0 && <thead>
<tr>
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr>
</thead>}
<tbody>
{rows.map(row => <tr key={row.id}>
{row.cells.map(cell => <td key={cell.id} {...cell.attributes}>
@ -60,11 +60,11 @@ export default function Schedule({
</td>)}
</tr>)}
</tbody>
<tfoot>
{header.length > 0 && <tfoot>
<tr>
{header.map(hall => <th key={hall.id}>{hall.name[lang]}</th>)}
</tr>
</tfoot>
</tfoot>}
</table>
<div className="separator"/>
<table>