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