import { esc } from './sanitize.js'; export function buildViewerMeta(item) { var parts = []; if (item.category_name) parts.push(item.category_name); if (item.subject) parts.push(item.subject); if (item.author_name) parts.push('by ' + item.author_name); if (item.created_at) parts.push(new Date(item.created_at).toLocaleDateString()); return parts.join(' | '); } export function renderPresentationCard(item) { var slideCount = (item.body || '').split(/\n---\n/).length; var slideButtonStyle = 'padding:11px 28px;font-size:14px;border-radius:10px;border:none;' + 'cursor:pointer;background:var(--blue);color:white;font-weight:600;'; return '
' + '
๐Ÿ“Š
' + '

' + esc(item.title) + '

' + '

' + slideCount + ' slides' + (item.subject ? ' ยท ' + esc(item.subject) : '') + '

' + '' + '
'; } export function renderProgressList(progress) { return (progress || []).map(function(p) { var pct = p.total > 0 ? Math.round((p.score / p.total) * 100) : 0; var date = new Date(p.completed_at).toLocaleDateString(); var color = pct >= 70 ? 'var(--green)' : 'var(--amber)'; return '
' + '' + date + '' + '' + p.score + '/' + p.total + ' (' + pct + '%)' + '' + '
'; }).join(''); }