import {
Rss, Activity, TrendingUp, AlertTriangle, Globe,
Database, Zap, BarChart3, LineChart, Map, Target, Radar, Grid3X3
} from 'lucide-react';
interface WidgetContentProps {
type: string;
}
// Mini widget components for dashboard
const NewsWidget = () => {
const news = [
{ title: "Critical Zero-Day Exploit", severity: "critical", time: "2m" },
{ title: "APT Group Activity Detected", severity: "high", time: "15m" },
{ title: "New Ransomware Variant", severity: "high", time: "32m" },
];
return (
{news.map((item, i) => (
{item.title}
{item.severity}
• {item.time}
))}
);
};
const DataStreamsWidget = () => {
const streams = [
{ name: "Network Traffic", rate: "2.4 GB/s", ok: true },
{ name: "Log Ingestion", rate: "12K/s", ok: true },
{ name: "Alert Pipeline", rate: "847/min", ok: false },
];
return (
{streams.map((s, i) => (
))}
);
};
const MetricsWidget = () => (
{[
{ label: "Threats", value: "127", change: "+12%" },
{ label: "Blocked", value: "8,432", change: "+23%" },
{ label: "Vulns", value: "45", change: "-8%" },
{ label: "Risk", value: "72", change: "+5" },
].map((m, i) => (
))}
);
const AlertsWidget = () => {
const alerts = [
{ type: "CRITICAL", msg: "Unauthorized access attempt", time: "Now" },
{ type: "WARNING", msg: "Unusual outbound traffic", time: "5m" },
];
return (
{alerts.map((a, i) => (
{a.type}
{a.time}
{a.msg}
))}
);
};
const GlobalWidget = () => (
{[
{ region: "North America", threats: 234, up: true },
{ region: "Europe", threats: 189, up: false },
{ region: "Asia Pacific", threats: 412, up: true },
].map((r, i) => (
{r.region}
{r.threats} {r.up ? '↑' : '↓'}
))}
);
const DatabaseWidget = () => (
{[
{ name: "Threat Intel DB", status: "online" },
{ name: "Log Archive", status: "online" },
{ name: "IOC Database", status: "syncing" },
].map((db, i) => (
{db.name}
{db.status}
))}
);
const EventsWidget = () => (
{[
{ type: "AUTH", msg: "Failed login from 192.168.1.45" },
{ type: "NET", msg: "Unknown IP connection" },
{ type: "FILE", msg: "Suspicious file quarantined" },
].map((e, i) => (
[{e.type}]
{e.msg}
))}
);
const StatisticsWidget = () => (
{[
{ label: "Malware", value: 89 },
{ label: "Phishing", value: 67 },
{ label: "Brute Force", value: 45 },
].map((s, i) => (
))}
);
const TrendsWidget = () => {
const data = [20, 35, 45, 80, 65, 90, 70];
return (
{data.map((v, i) => (
))}
);
};
const ThreatMapWidget = () => (
{[
{ x: 20, y: 30, pulse: true },
{ x: 45, y: 25, pulse: false },
{ x: 70, y: 40, pulse: true },
].map((p, i) => (
))}
3 hotspots
);
const TargetWidget = () => (
{[100, 75, 50, 25].map((size, i) => (
))}
);
const RadarWidget = () => (
{[100, 66, 33].map((size, i) => (
))}
);
const GridWidget = () => {
const grid = Array.from({ length: 16 }).map(() => Math.random() > 0.75);
return (
{grid.map((active, i) => (
))}
);
};
const WidgetContent = ({ type }: WidgetContentProps) => {
const widgets: Record = {
news: ,
datastreams: ,
metrics: ,
alerts: ,
global: ,
database: ,
events: ,
statistics: ,
trends: ,
threatmap: ,
target: ,
radar: ,
grid: ,
};
return widgets[type] || Widget not found
;
};
export default WidgetContent;