// Generated, do not edit. sha256:0bce2d8ce656c1145d2eaf8627da39c4fe16f1583c0379c2a0fa2919e295eae7 import { t } from '../i18n/index.js'; import { renderAiProposals } from '../actions/ai-proposals-widget.js'; import { renderReconcile } from '../actions/reconcile-widget.js'; import { renderInterestWidget } from '../actions/interest-widget.js'; import { renderValuationWidget } from '../actions/valuation-widget.js'; import { renderReservationsWidget } from '../actions/reservations-widget.js'; import { fmtInt } from '../ui/format.js'; import { esc } from '../ui/escape.js'; import { CHECK } from '../ui/icons.js'; export const title = () => t('actions.title'); export const headerInColumn = true; const BLOKKEN = [ { id: 'act-ai', label: () => t('aiProposals.title') }, { id: 'act-reconcile', label: () => t('home.reconcile') }, { id: 'act-interest', label: () => t('actions.interestTitle') }, { id: 'act-valuation', label: () => t('actions.valuationTitle') }, { id: 'act-reservation', label: () => t('reservations.title') }, ]; export async function render(el) { el.innerHTML = `
`; const refresh = () => render(el); const aantal = {}; for (const [id, teken] of [['act-ai', renderAiProposals], ['act-reconcile', renderReconcile], ['act-interest', renderInterestWidget], ['act-valuation', renderValuationWidget], ['act-reservation', renderReservationsWidget]]) { const host = el.querySelector('#' + id); if (!host) return; aantal[id] = await teken(host, refresh); } vulKolom(el, aantal); } function vulKolom(el, aantal) { const zichtbaar = BLOKKEN.filter(b => aantal[b.id] != null); const totaal = zichtbaar.reduce((som, b) => som + aantal[b.id], 0); const zet = (sleutel, html) => { const e = el.querySelector(`[data-act="${sleutel}"]`); if (e) e.innerHTML = html; }; zet('total', totaal ? fmtInt(totaal) : CHECK); zet('totalSub', totaal ? (totaal === 1 ? t('actions.openOne') : t('actions.openMany')) : t('actions.openNone')); const nav = el.querySelector('[data-jump]'); if (!nav) return; nav.innerHTML = zichtbaar.map(b => ` `).join(''); nav.onclick = e => { const knop = e.target.closest('[data-to]'); if (!knop) return; const doel = el.querySelector('#' + knop.dataset.to); if (doel) doel.scrollIntoView({ behavior: 'smooth', block: 'start' }); }; }