import type { ReactNode } from "react"; import { Col, Descriptions, Divider, Row, Skeleton, Space, Statistic } from "tdesign-react"; import type { TargetMetricsResponse, TargetStatus } from "../../shared/api"; import { formatDurationUnit } from "../utils/time"; import { TrendChart } from "./TrendChart"; interface OverviewStatItemProps { color?: string; suffix?: ReactNode; title: string; value: number; } interface OverviewTabProps { metricsData: null | TargetMetricsResponse; metricsLoading: boolean; target: TargetStatus; } export function OverviewTab({ metricsData, metricsLoading, target }: OverviewTabProps) { const stats = metricsData?.stats ?? null; const mttr = formatDurationUnit(stats?.mttr ?? null); const longestOutage = formatDurationUnit(stats?.longestOutage ?? null); const currentUpStreak = stats?.currentStreak?.up ? stats.currentStreak.count : 0; return ( 基本信息 统计 {metricsLoading ? ( ) : stats ? ( ) : (
暂无指标数据
)} 趋势 {metricsLoading ? ( ) : metricsData ? ( ) : (
暂无趋势数据
)}
); } function OverviewStatItem({ color, suffix, title, value }: OverviewStatItemProps) { return (
); }