feat(админка): таблица клиентов v2

This commit is contained in:
anor
2026-11-06 21:35:34 +10:00
parent 47c1a93b99
commit c7558f2772
7 changed files with 220 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
import { h } from '/static/admin2/vendor/preact.module.js';
import htm from '/static/admin2/vendor/htm.module.js';
const html = htm.bind(h);
export const Table = ({ columns, rows, empty = 'Никого не нашлось' }) => html`
<div class="table-wrap">
<table>
<thead><tr>${columns.map((c) => html`<th key=${c.key} class=${c.num ? 'num' : ''}>${c.label}</th>`)}</tr></thead>
<tbody>${rows.length ? rows.map((row) => html`
<tr key=${row.key}>${columns.map((c) => html`
<td key=${c.key} class=${c.num ? 'num' : ''}>${c.render ? c.render(row) : row[c.key]}</td>`)}</tr>`)
: html`<tr><td colSpan=${columns.length} class="empty">${empty}</td></tr>`}</tbody>
</table>
</div>`;