1+ import { Badge , Card , type BadgeProps } from '@/src/shared/components/ui' ;
12import type { AnalysisResult , ProductSummary } from '@/src/features/analysis/types' ;
23
34interface InsightReportProps {
45 result : AnalysisResult ;
56}
67
7- const SEVERITY_BADGE : Record < string , string > = {
8- high : 'bg-red-100 text-red-800 ' ,
9- medium : 'bg-amber-100 text-amber-800 ' ,
10- low : 'bg-gray-100 text-gray-700 ' ,
8+ const SEVERITY_VARIANT : Record < string , NonNullable < BadgeProps [ 'variant' ] > > = {
9+ high : 'danger ' ,
10+ medium : 'warning ' ,
11+ low : 'neutral ' ,
1112} ;
1213
13- function severityBadge ( severity : string ) : string {
14- return SEVERITY_BADGE [ severity ] ?? 'bg-gray-100 text-gray-700 ' ;
14+ function severityVariant ( severity : string ) : NonNullable < BadgeProps [ 'variant' ] > {
15+ return SEVERITY_VARIANT [ severity ] ?? 'neutral ' ;
1516}
1617
1718function Section ( { title, children } : { title : string ; children : React . ReactNode } ) {
1819 return (
19- < section className = "rounded-lg border border-gray-200 bg-white p-6 shadow-sm " >
20+ < Card className = "p-6" >
2021 < h2 className = "mb-4 text-lg font-semibold text-gray-900" > { title } </ h2 >
2122 { children }
22- </ section >
23+ </ Card >
2324 ) ;
2425}
2526
@@ -79,7 +80,7 @@ export function InsightReport({ result }: InsightReportProps) {
7980 < ol className = "flex flex-col gap-4" >
8081 { improvements . map ( ( point ) => (
8182 < li key = { point . rank } className = "flex gap-3" >
82- < span className = "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-blue -600 text-sm font-bold text-white" >
83+ < span className = "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-brand -600 text-sm font-bold text-white" >
8384 { point . rank }
8485 </ span >
8586 < div >
@@ -115,7 +116,7 @@ export function InsightReport({ result }: InsightReportProps) {
115116 { insights . purchase_drivers . map ( ( driver , i ) => (
116117 < li
117118 key = { i }
118- className = "rounded-full bg-blue -50 px-3 py-1 text-sm text-blue -700"
119+ className = "rounded-full bg-brand -50 px-3 py-1 text-sm text-brand -700"
119120 >
120121 { driver }
121122 </ li >
@@ -136,11 +137,7 @@ export function InsightReport({ result }: InsightReportProps) {
136137 < li key = { i } className = "flex items-center justify-between gap-2" >
137138 < span className = "text-sm text-gray-800" > { c . text } </ span >
138139 < span className = "flex items-center gap-2" >
139- < span
140- className = { `rounded-full px-2 py-0.5 text-xs font-medium ${ severityBadge ( c . severity ) } ` }
141- >
142- { c . severity }
143- </ span >
140+ < Badge variant = { severityVariant ( c . severity ) } > { c . severity } </ Badge >
144141 < span className = "text-xs text-gray-500" > { c . count } 회</ span >
145142 </ span >
146143 </ li >
0 commit comments