repositories / pi-ext
pi-ext
bugabingas pi extensions
owned by bugabinga
extensions/ui/web/components/digest-indicator.js.ts
Rawexport function digestIndicatorText(count: number): string {
return count > 0 ? `digest will be sent · ${count} events` : "digest empty";
}
export function renderDigestIndicatorJs(): string {
return `let telemetryEventCount = 0;
function setDigestIndicator(count) {
telemetryEventCount = count;
const indicator = document.querySelector('#ui-digest');
if (!indicator) return;
indicator.textContent = count > 0 ? 'digest will be sent · ' + count + ' events' : 'digest empty';
indicator.open = count > 0;
}
`;
}