import { Target } from "../ui/icons"; import type { CompanyMetrics, SectionId } from "@shared/types"; import { formatDuration, formatMoney, getAgentInitials } from "../../lib/formatters"; import { useT } from "../../i18n"; import { CompactMetric, RunProgressBar } from "./inbox-helpers"; import { Card, Eyebrow } from "../ui"; interface PerformanceProps { metrics: CompanyMetrics | null; onNavigate: (section: SectionId, entityId?: string) => void; } export function PerformanceView({ metrics, onNavigate }: PerformanceProps) { const t = useT(); if (!metrics) { return (
| {t("perf.agent")} | {t("perf.tasksDoneCol")} | {t("perf.successPct")} | {t("perf.runsCol")} | {t("perf.avgDuration")} | {t("perf.costCol")} |
|---|---|---|---|---|---|
|
{getAgentInitials(am.agentName)}
{am.agentName}
|
{am.tasksCompleted} | = 80 ? "text-success" : am.successRate >= 50 ? "text-warning" : "text-destructive" }`}> {am.successRate}% | {am.runsTotal} | {formatDuration(am.avgRunDurationSec)} | {formatMoney(am.totalCostUsd)} |