${this.windowLabel(w.days)}
${this.t('{{count}} events', { count: w.count ?? 0 })}
${
domains.length > 0
? html`
${domains.map(
([dom, n]) => html`
${humanize(dom)} ${n}
`,
)}
`
: nothing
}
${
top.length > 0
? html`${top.map((e) => this.renderEvent(e))}
`
: html`${this.t('No notable events.')}
`
}
`;
}
private renderEvent(e: DigestEvent) {
const sig = typeof e.significance === 'number' ? e.significance : 0;
// Hiding the readings reuses the shape a description-less event already
// renders in, rather than inventing a second headline builder or leaving the
// row blank.
const label =
this.hideReadings || e.description == null
? humanize(e.type ?? '')
: e.description;
return html`