import { Avatar, Badge, Group, Paper, Stack, Text } from "@mantine/core"; import { IconAlertTriangle } from "@tabler/icons-react"; import type { TracearrViolation } from "@homarr/integrations/types"; import { useCurrentIntlLocale, useI18n } from "@homarr/translation/client"; import type { SourcedTracearrItem } from "./source"; type SourcedTracearrViolation = SourcedTracearrItem; export function ViolationsList({ violations, showSource, transparent = false, }: { violations: SourcedTracearrViolation[]; showSource: boolean; transparent?: boolean; }) { const t = useI18n("widget.tracearr"); const locale = useCurrentIntlLocale(); return ( {t("violations.title")} {violations.length === 0 ? ( {t("violations.empty")} ) : ( {violations.map((violation) => ( {violation.user.username} {t("violations.rule")}: {violation.rule.name} {showSource ? ` ยท ${violation.integrationName}` : ""} {violation.severity} {new Date(violation.createdAt).toLocaleDateString(locale)} ))} )} ); }