Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render

This commit is contained in:
2026-06-04 07:52:57 +02:00
parent 0b33a1b074
commit 15870ddb1f
191 changed files with 15453 additions and 1786 deletions

View File

@@ -7,7 +7,16 @@ function MetricCell({ value, suffix = '' }) {
return <span className="font-semibold text-white">{value}{suffix}</span>
}
export default function AcademyAnalyticsContent({ nav = [], range, title, subtitle, rows = [] }) {
function StatCard({ label, value, suffix = '' }) {
return (
<div className="rounded-2xl border border-white/[0.08] bg-white/[0.04] p-5">
<p className="text-[11px] font-semibold uppercase tracking-[0.2em] text-slate-500">{label}</p>
<p className="mt-3 text-3xl font-bold text-white">{value}{suffix}</p>
</div>
)
}
export default function AcademyAnalyticsContent({ nav = [], range, title, subtitle, summary = null, rows = [] }) {
return (
<AdminLayout title={title} subtitle={subtitle}>
<Head title={`Admin · ${title}`} />
@@ -20,6 +29,19 @@ export default function AcademyAnalyticsContent({ nav = [], range, title, subtit
<p className="mt-3 text-sm text-slate-300">{range?.from} to {range?.to}</p>
</div>
{summary ? (
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
<StatCard label="Views" value={Number(summary.views || 0).toLocaleString()} />
<StatCard label="Unique Visitors" value={Number(summary.uniqueVisitors || 0).toLocaleString()} />
<StatCard label="Engaged Views" value={Number(summary.engagedViews || 0).toLocaleString()} />
<StatCard label="Engagement Rate" value={Number(summary.engagementRate || 0).toLocaleString()} suffix="%" />
<StatCard label="Avg Engaged Seconds" value={Number(summary.avgEngagedSeconds || 0).toLocaleString()} suffix="s" />
<StatCard label="Scroll 50%" value={Number(summary.scroll50 || 0).toLocaleString()} />
<StatCard label="Scroll 100%" value={Number(summary.scroll100 || 0).toLocaleString()} />
<StatCard label="Deep Scroll Rate" value={Number(summary.deepScrollRate || 0).toLocaleString()} suffix="%" />
</div>
) : null}
<div className="overflow-hidden rounded-[28px] border border-white/[0.08] bg-white/[0.03]">
<div className="overflow-x-auto">
<table className="min-w-full text-left text-sm">