"use client" import Link from "next/link" import { ArrowRightIcon, ShieldAlertIcon } from "lucide-react" import type { DashboardAlert } from "@/lib/api/dashboard" import { Badge } from "@/components/ui/badge" import { useI18n } from "@/i18n/provider" import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card" type AlertListProps = { alerts: DashboardAlert[] } function getAlertBadgeVariant(level: DashboardAlert["level"]) { if (level === "error") { return "destructive" as const } if (level === "warning") { return "secondary" as const } return "outline" as const } export function AlertList({ alerts }: AlertListProps) { const t = useI18n() return ( {t("dashboardHome.riskAlerts")} {t("dashboardHome.riskAlertsDescription")} {alerts.length === 0 ? (
{t("dashboardHome.noRiskTitle")}
{t("dashboardHome.noRiskDescription")}
) : ( alerts.map((item) => (
{item.title}
{item.count}
{item.description}
)) )}
) }