import { memo } from 'react'; import { PieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer } from 'recharts'; import { EmptyState } from '@/components/ui'; import { CHART_COLORS } from './chartColors'; export interface AlertSlice { name: string; value: number; color: string; } interface AlertSeverityDonutProps { data: AlertSlice[]; embed?: boolean; } const tooltipStyle = { backgroundColor: '#FFFFFF', border: `1px solid ${CHART_COLORS.tooltipBorder}`, borderRadius: '10px', fontSize: '12px', }; function AlertSeverityDonutComponent({ data, embed }: AlertSeverityDonutProps) { const hasData = data.some((d) => d.value > 0); const body = ( <> {embed ? (
P1 紧急 / P2 关注