Files

12 lines
492 B
JavaScript

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 Card = ({ title, value, note, children, badge }) => html`
<section class="card">
<header class="card-head"><h2>${title}</h2>${badge && html`<span class="badge">${badge}</span>`}</header>
${value != null && html`<div class="value">${value}</div>`}
${note && html`<p class="note">${note}</p>`}
${children}
</section>`;