MBO-Tech-IT-Webseite/components/FlyerReportPreview.tsx

88 lines
2.7 KiB
TypeScript

const monthlyData = [
{ month: "Okt", value: 189 },
{ month: "Nov", value: 203 },
{ month: "Dez", value: 231 },
{ month: "Jan", value: 198 },
{ month: "Feb", value: 215 },
{ month: "Mär", value: 247 },
];
const maxValue = Math.max(...monthlyData.map((d) => d.value));
const topThreats = [
{ label: "Werbung & Tracker", value: 112 },
{ label: "Erwachseneninhalte", value: 54 },
{ label: "Phishing-Versuche", value: 38 },
{ label: "Schadsoftware-Domains", value: 24 },
{ label: "Social-Media-Tracker", value: 19 },
];
const maxThreatValue = Math.max(...topThreats.map((t) => t.value));
const stats = [
{ value: 247, suffix: "", label: "Blockierte Gefahren (Mär)", },
{ value: 6, suffix: "", label: "Geschützte Geräte", },
{ value: 100, suffix: "%", label: "Automatisch aktuell", },
];
export default function FlyerReportPreview() {
return (
<div className="report">
<div className="head head--split" style={{ marginBottom: 0 }}>
<h2>So sieht Ihre monatliche Übersicht aus</h2>
<p className="lead">
Beispielhafte Darstellung des MBO FamilyGuard Reports: Ihre echte monatliche E-Mail zeigt die tatsächlichen
Werte für Ihr Zuhause.
</p>
</div>
<div className="report__stats">
{stats.map((s) => (
<div key={s.label}>
<b>
{s.value}
{s.suffix}
</b>
<span>{s.label}</span>
</div>
))}
</div>
<div className="report__charts">
<figure style={{ margin: 0 }}>
<figcaption className="report__label">Blockierte Gefahren, letzte 6 Monate</figcaption>
<div className="bars">
{monthlyData.map((d, i) => (
<div key={d.month} className={i === monthlyData.length - 1 ? "is-now" : undefined}>
<span>{d.value}</span>
<i style={{ height: `${(d.value / maxValue) * 100}%` }} />
</div>
))}
</div>
<div className="bars-x" aria-hidden="true">
{monthlyData.map((d) => (
<span key={d.month}>{d.month}</span>
))}
</div>
</figure>
<figure style={{ margin: 0 }}>
<figcaption className="report__label">Top 5 blockierte Gefahren (Mär)</figcaption>
<ol className="meter">
{topThreats.map((t, i) => (
<li key={t.label}>
<span>{i + 1}</span>
<span>{t.label}</span>
<span className="meter__track">
<i style={{ width: `${(t.value / maxThreatValue) * 100}%` }} />
</span>
<b>{t.value}</b>
</li>
))}
</ol>
</figure>
</div>
</div>
);
}