11import { useState } from 'react'
2+ import { Button } from '@/components/ui/button'
3+ import { Input } from '@/components/ui/input'
4+ import { Label } from '@/components/ui/label'
25
36interface ImpactAnalyzerProps {
47 repoId : string
@@ -60,47 +63,45 @@ export function ImpactAnalyzer({ repoId, apiUrl, apiKey }: ImpactAnalyzerProps)
6063
6164 const getRiskColor = ( risk : string ) => {
6265 switch ( risk ) {
63- case 'high' : return 'text-red-400 bg-red-500 /10 border-red-500 /20'
64- case 'medium' : return 'text-yellow-400 bg-yellow-500/10 border-yellow-500/20'
65- case 'low' : return 'text-green-400 bg-green-500/10 border-green-500/20'
66- default : return 'text-gray-400 bg-white/5 border-white/10 '
66+ case 'high' : return 'text-destructive bg-destructive /10 border-destructive /20'
67+ case 'medium' : return 'text-yellow-500 dark:text-yellow- 400 bg-yellow-500/10 border-yellow-500/20'
68+ case 'low' : return 'text-green-500 dark:text-green- 400 bg-green-500/10 border-green-500/20'
69+ default : return 'text-muted-foreground bg-muted border-border '
6770 }
6871 }
6972
7073 return (
7174 < div className = "p-6 space-y-6" >
7275 { /* Input Form */ }
73- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
74- < h3 className = "text-base font-semibold mb-4 text-white " > Analyze Change Impact</ h3 >
76+ < div className = "bg-muted border border-border rounded-xl p-5" >
77+ < h3 className = "text-base font-semibold mb-4 text-foreground " > Analyze Change Impact</ h3 >
7578 < form onSubmit = { analyzeImpact } className = "space-y-4" >
76- < div >
77- < label className = "block text-sm font-medium mb-2 text-gray-300" >
78- File Path (relative to repository root)
79- </ label >
80- < input
79+ < div className = "space-y-2" >
80+ < Label htmlFor = "filePath" > File Path (relative to repository root)</ Label >
81+ < Input
82+ id = "filePath"
8183 type = "text"
8284 value = { filePath }
8385 onChange = { ( e ) => setFilePath ( e . target . value ) }
8486 placeholder = "e.g., src/auth/middleware.py or components/Button.tsx"
85- className = "w-full px-4 py-3 bg-white/5 border border-white/10 rounded-xl text-white placeholder:text-gray-500 focus:outline-none focus:border-blue-500/50 focus:ring-1 focus:ring-blue-500/20 transition-all"
8687 disabled = { loading }
8788 />
88- < p className = "mt-2 text-xs text-gray-500 " >
89+ < p className = "text-xs text-muted-foreground " >
8990 Enter the path of the file you want to modify to see its impact
9091 </ p >
9192 </ div >
9293
93- < button
94+ < Button
9495 type = "submit"
95- className = "px-4 py-2.5 bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white font-medium rounded-lg transition-all disabled:opacity-50"
9696 disabled = { loading }
97+ className = "bg-primary hover:bg-primary/90 text-primary-foreground"
9798 >
9899 { loading ? 'Analyzing...' : 'Analyze Impact' }
99- </ button >
100+ </ Button >
100101 </ form >
101102
102103 { error && (
103- < div className = "mt-4 p-4 bg-red-500 /10 border border-red-500 /20 rounded-lg text-sm text-red-400 " >
104+ < div className = "mt-4 p-4 bg-destructive /10 border border-destructive /20 rounded-lg text-sm text-destructive " >
104105 { error }
105106 </ div >
106107 ) }
@@ -110,85 +111,85 @@ export function ImpactAnalyzer({ repoId, apiUrl, apiKey }: ImpactAnalyzerProps)
110111 { result && (
111112 < div className = "space-y-6" >
112113 { /* Risk Assessment */ }
113- < div className = { `bg-[#0a0a0c] rounded-xl p-5 border-2 ${ getRiskColor ( result . risk_level ) } ` } >
114+ < div className = { `bg-muted rounded-xl p-5 border-2 ${ getRiskColor ( result . risk_level ) } ` } >
114115 < div className = "flex items-center justify-between mb-3" >
115- < h3 className = "text-lg font-semibold text-white " > Risk Assessment</ h3 >
116+ < h3 className = "text-lg font-semibold text-foreground " > Risk Assessment</ h3 >
116117 < span className = { `px-4 py-1.5 rounded-lg font-semibold uppercase text-sm border ${ getRiskColor ( result . risk_level ) } ` } >
117118 { result . risk_level } Risk
118119 </ span >
119120 </ div >
120- < p className = "text-sm font-mono text-gray-300 mb-4" >
121+ < p className = "text-sm font-mono text-foreground mb-4" >
121122 { result . file }
122123 </ p >
123- < p className = "text-sm text-gray-400 " >
124+ < p className = "text-sm text-muted-foreground " >
124125 { result . impact_summary }
125126 </ p >
126127 </ div >
127128
128129 { /* Impact Overview */ }
129130 < div className = "grid grid-cols-1 md:grid-cols-3 gap-4" >
130- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
131- < div className = "text-sm text-gray-400 mb-1" > Direct Dependencies</ div >
132- < div className = "text-3xl font-bold text-blue-500 " >
131+ < div className = "bg-muted border border-border rounded-xl p-5" >
132+ < div className = "text-sm text-muted-foreground mb-1" > Direct Dependencies</ div >
133+ < div className = "text-3xl font-bold text-primary " >
133134 { result . dependency_count }
134135 </ div >
135- < div className = "text-xs text-gray-500 mt-1" >
136+ < div className = "text-xs text-muted-foreground mt-1" >
136137 Files this imports
137138 </ div >
138139 </ div >
139140
140- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
141- < div className = "text-sm text-gray-400 mb-1" > Total Impact</ div >
142- < div className = "text-3xl font-bold text-blue-500 " >
141+ < div className = "bg-muted border border-border rounded-xl p-5" >
142+ < div className = "text-sm text-muted-foreground mb-1" > Total Impact</ div >
143+ < div className = "text-3xl font-bold text-primary " >
143144 { result . dependent_count }
144145 </ div >
145- < div className = "text-xs text-gray-500 mt-1" >
146+ < div className = "text-xs text-muted-foreground mt-1" >
146147 Files affected by changes
147148 </ div >
148149 </ div >
149150
150- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
151- < div className = "text-sm text-gray-400 mb-1" > Test Files</ div >
152- < div className = "text-3xl font-bold text-blue-500 " >
151+ < div className = "bg-muted border border-border rounded-xl p-5" >
152+ < div className = "text-sm text-muted-foreground mb-1" > Test Files</ div >
153+ < div className = "text-3xl font-bold text-primary " >
153154 { result . test_files ?. length || 0 }
154155 </ div >
155- < div className = "text-xs text-gray-500 mt-1" >
156+ < div className = "text-xs text-muted-foreground mt-1" >
156157 Related test coverage
157158 </ div >
158159 </ div >
159160 </ div >
160161
161- { /* Dependencies (What This File Needs) */ }
162+ { /* Dependencies */ }
162163 { result . direct_dependencies && result . direct_dependencies . length > 0 && (
163- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
164- < h3 className = "text-base font-semibold mb-4 text-white " >
164+ < div className = "bg-muted border border-border rounded-xl p-5" >
165+ < h3 className = "text-base font-semibold mb-4 text-foreground " >
165166 Dependencies ({ result . direct_dependencies . length } )
166167 </ h3 >
167- < p className = "text-sm text-gray-400 mb-3" >
168+ < p className = "text-sm text-muted-foreground mb-3" >
168169 Files this file imports (upstream)
169170 </ p >
170171 < div className = "space-y-1.5" >
171172 { result . direct_dependencies . map ( ( dep , idx ) => (
172- < div key = { idx } className = "text-sm font-mono text-gray-300 bg-blue-500 /10 border border-blue-500 /20 px-3 py-2 rounded-lg" >
173+ < div key = { idx } className = "text-sm font-mono text-foreground bg-primary /10 border border-primary /20 px-3 py-2 rounded-lg" >
173174 { dep }
174175 </ div >
175176 ) ) }
176177 </ div >
177178 </ div >
178179 ) }
179180
180- { /* Dependents (What Breaks If Changed) */ }
181+ { /* Dependents */ }
181182 { result . all_dependents && result . all_dependents . length > 0 && (
182- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
183- < h3 className = "text-base font-semibold mb-4 text-white " >
183+ < div className = "bg-muted border border-border rounded-xl p-5" >
184+ < h3 className = "text-base font-semibold mb-4 text-foreground " >
184185 Affected Files ({ result . all_dependents . length } )
185186 </ h3 >
186- < p className = "text-sm text-gray-400 mb-3" >
187+ < p className = "text-sm text-muted-foreground mb-3" >
187188 Files that would be impacted by changes to this file (downstream)
188189 </ p >
189190 < div className = "space-y-1.5 max-h-96 overflow-y-auto" >
190191 { result . all_dependents . map ( ( dep , idx ) => (
191- < div key = { idx } className = "text-sm font-mono text-gray-300 bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 rounded-lg" >
192+ < div key = { idx } className = "text-sm font-mono text-foreground bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 rounded-lg" >
192193 { dep }
193194 </ div >
194195 ) ) }
@@ -198,16 +199,16 @@ export function ImpactAnalyzer({ repoId, apiUrl, apiKey }: ImpactAnalyzerProps)
198199
199200 { /* Test Files */ }
200201 { result . test_files && result . test_files . length > 0 && (
201- < div className = "bg-[#0a0a0c] border border-white/5 rounded-xl p-5" >
202- < h3 className = "text-base font-semibold mb-4 text-white " >
202+ < div className = "bg-muted border border-border rounded-xl p-5" >
203+ < h3 className = "text-base font-semibold mb-4 text-foreground " >
203204 Related Tests ({ result . test_files . length } )
204205 </ h3 >
205- < p className = "text-sm text-gray-400 mb-3" >
206+ < p className = "text-sm text-muted-foreground mb-3" >
206207 Test files that may need updates
207208 </ p >
208209 < div className = "space-y-1.5" >
209210 { result . test_files . map ( ( test , idx ) => (
210- < div key = { idx } className = "text-sm font-mono text-gray-300 bg-green-500/10 border border-green-500/20 px-3 py-2 rounded-lg" >
211+ < div key = { idx } className = "text-sm font-mono text-foreground bg-green-500/10 border border-green-500/20 px-3 py-2 rounded-lg" >
211212 { test }
212213 </ div >
213214 ) ) }
0 commit comments