import { Award, Percent, RefreshCw, Target, TrendingDown, CircleCheckBig } from 'lucide-react'; import { Panel } from './components/Panel'; import { StatTile } from './components/StatTile'; import { SavingsTrendChart } from './components/SavingsTrendChart'; import { MarkupTrendChart } from './components/MarkupTrendChart'; import { OutcomeChart } from './components/OutcomeChart'; import { ParticipationChart } from './components/ParticipationChart'; import { TypeSplitChart } from './components/TypeSplitChart'; import { CategoryChart } from './components/CategoryChart'; import { CardEffectChart } from './components/CardEffectChart'; import { CardTop5 } from './components/CardTop5'; import { wonCompact, pct, signedWonCompact } from './fmt'; import { fillMonths } from './months'; import type { StatData } from './types'; import { useLabels } from '@/features/settings/useCompanySettings'; // 통계 본문. KPI 요약 + 절감 분석 + 성사/프로세스 + 카드 효과. scope(회사/내견적)별로 동일 레이아웃. export function StatisticsView({ data }: { data: StatData }) { const label = useLabels(); // 회사 설정 용어(카테고리 등) const k = data.kpi; // 월별 차트는 최근 6개월 축을 고정한다(데이터 없는 달은 0) — 한 점만 찍히던 현상 방지. const trend = fillMonths(data.trend, (month) => ({ month, savings: 0, rate: 0 })); const markupTrend = fillMonths(data.markupTrend, (month) => ({ month, rate: 0 })); return (
{/* 임팩트 요약 KPI — 6열은 초광폭(2xl)에서만. xl 구간은 사이드바 빼면 타일이 ~170px 로 눌려 라벨·증감칩이 여러 줄로 깨진다 → 3열 유지. */}
= 0 }} /> 0 ? { text: `오프라인 반영 ${k.offlineAwardCount}건` } : undefined} />
{/* 월별 추이 2종 — 같은 성격이라 동일 폭(1:1) */}
{/* 성사 · 프로세스 */}
{/* 카테고리 · 카드 */}
); }