// File: components/ai/intent-classification/analytics/intent-breakdown-table.tsx // Change Log // - 2026-05-19: สร้าง Intent Breakdown Table สำหรับ Analytics Dashboard (T036, US3). 'use client'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table'; import { Progress } from '@/components/ui/progress'; import type { IntentStats } from '@/lib/services/ai-intent.service'; interface IntentBreakdownTableProps { data: IntentStats[]; } /** * ตารางแสดงสถิติแยกตาม intent code พร้อม bar แสดง pattern vs llm */ export function IntentBreakdownTable({ data }: IntentBreakdownTableProps) { if (data.length === 0) { return

ยังไม่มีข้อมูล

; } return ( Intent Code Total Pattern LLM Avg Confidence Pattern Rate {data.map((row) => { const patternRate = row.count > 0 ? (row.patternHits / row.count) * 100 : 0; return ( {row.intentCode} {row.count} {row.patternHits} {row.llmHits} {row.avgConfidence.toFixed(2)}
{patternRate.toFixed(0)}%
); })}
); }