11import { useState } from 'react'
22import { motion , AnimatePresence } from 'framer-motion'
3- import { Package , Plus , X } from 'lucide-react'
3+ import { Package , Plus , X , Loader2 } from 'lucide-react'
4+ import { Button } from '@/components/ui/button'
5+ import { Input } from '@/components/ui/input'
6+ import { Label } from '@/components/ui/label'
47
58interface AddRepoFormProps {
69 onAdd : ( gitUrl : string , branch : string ) => Promise < void >
@@ -23,47 +26,45 @@ export function AddRepoForm({ onAdd, loading }: AddRepoFormProps) {
2326
2427 return (
2528 < >
26- < motion . button
27- whileHover = { { scale : 1.02 } }
28- whileTap = { { scale : 0.98 } }
29+ < Button
2930 onClick = { ( ) => setShowForm ( true ) }
30- className = "px-5 py-2.5 bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-blue-500/20 flex items-center gap-2"
3131 disabled = { loading }
32+ className = "bg-primary hover:bg-primary/90 text-primary-foreground gap-2"
3233 >
33- < span className = "text-lg" > + </ span >
34- < span > Add Repository</ span >
35- </ motion . button >
34+ < Plus className = "w-4 h-4" / >
35+ Add Repository
36+ </ Button >
3637
3738 < AnimatePresence >
3839 { showForm && (
3940 < motion . div
4041 initial = { { opacity : 0 } }
4142 animate = { { opacity : 1 } }
4243 exit = { { opacity : 0 } }
43- className = "fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50"
44+ className = "fixed inset-0 bg-background/80 backdrop-blur-md flex items-center justify-center z-50"
4445 onClick = { ( ) => ! loading && setShowForm ( false ) }
4546 >
4647 < motion . div
4748 initial = { { opacity : 0 , scale : 0.95 , y : 20 } }
4849 animate = { { opacity : 1 , scale : 1 , y : 0 } }
4950 exit = { { opacity : 0 , scale : 0.95 , y : 20 } }
5051 onClick = { e => e . stopPropagation ( ) }
51- className = "bg-gradient-to-br from-[#111113] to-[#0a0a0c] border border-white/10 rounded-2xl shadow-2xl w-full max-w-md mx-4"
52+ className = "bg-card border border-border rounded-xl shadow-2xl w-full max-w-md mx-4"
5253 >
5354 { /* Header */ }
54- < div className = "flex items-center justify-between p-6 border-b border-white/5 " >
55+ < div className = "flex items-center justify-between p-6 border-b border-border " >
5556 < div className = "flex items-center gap-3" >
56- < div className = "w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500/20 to-purple-500 /20 flex items-center justify-center" >
57- < Package className = "w-5 h-5 text-blue-400 " />
57+ < div className = "w-10 h-10 rounded-xl bg-primary/10 border border-primary /20 flex items-center justify-center" >
58+ < Package className = "w-5 h-5 text-primary " />
5859 </ div >
5960 < div >
60- < h3 className = "text-lg font-semibold text-white " > Add Repository</ h3 >
61- < p className = "text-sm text-gray-500 " > Clone and index with AI</ p >
61+ < h3 className = "text-lg font-semibold text-foreground " > Add Repository</ h3 >
62+ < p className = "text-sm text-muted-foreground " > Clone and index with AI</ p >
6263 </ div >
6364 </ div >
6465 < button
6566 onClick = { ( ) => setShowForm ( false ) }
66- className = "w-8 h-8 flex items-center justify-center rounded-lg text-gray-400 hover:text-white hover:bg-white/10 transition-colors"
67+ className = "w-8 h-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
6768 disabled = { loading }
6869 >
6970 < X className = "w-4 h-4" />
@@ -72,63 +73,62 @@ export function AddRepoForm({ onAdd, loading }: AddRepoFormProps) {
7273
7374 { /* Form */ }
7475 < form onSubmit = { handleSubmit } className = "p-6 space-y-5" >
75- < div >
76- < label className = "block text-sm font-medium mb-2 text-gray-300" > Git URL</ label >
77- < input
76+ < div className = "space-y-2" >
77+ < Label htmlFor = "gitUrl" > Git URL</ Label >
78+ < Input
79+ id = "gitUrl"
7880 type = "url"
7981 value = { gitUrl }
8082 onChange = { ( e ) => setGitUrl ( e . target . value ) }
8183 placeholder = "https://github.com/username/repo"
82- 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-2 focus:ring-blue-500/20 transition-all"
8384 required
8485 disabled = { loading }
8586 autoFocus
8687 />
8788 </ div >
8889
89- < div >
90- < label className = "block text-sm font-medium mb-2 text-gray-300" > Branch</ label >
91- < input
90+ < div className = "space-y-2" >
91+ < Label htmlFor = "branch" > Branch</ Label >
92+ < Input
93+ id = "branch"
9294 type = "text"
9395 value = { branch }
9496 onChange = { ( e ) => setBranch ( e . target . value ) }
9597 placeholder = "main"
96- 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-2 focus:ring-blue-500/20 transition-all"
9798 required
9899 disabled = { loading }
99100 />
100- < p className = "mt-2 text-xs text-gray-500 " > Repository will be cloned and automatically indexed</ p >
101+ < p className = "text-xs text-muted-foreground " > Repository will be cloned and automatically indexed</ p >
101102 </ div >
102103
103104 { /* Actions */ }
104105 < div className = "flex gap-3 pt-2" >
105- < button
106+ < Button
106107 type = "button"
108+ variant = "outline"
107109 onClick = { ( ) => { setShowForm ( false ) ; setGitUrl ( '' ) ; setBranch ( 'main' ) } }
108- className = "flex-1 px-4 py-3 bg-white/5 border border-white/10 text-gray-300 font-medium rounded-xl hover:bg-white/10 transition-colors disabled:opacity-50"
109110 disabled = { loading }
111+ className = "flex-1"
110112 >
111113 Cancel
112- </ button >
113- < motion . button
114- whileHover = { { scale : 1.02 } }
115- whileTap = { { scale : 0.98 } }
114+ </ Button >
115+ < Button
116116 type = "submit"
117- className = "flex-1 px-4 py-3 bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white font-medium rounded-xl transition-all disabled:opacity-50 flex items-center justify-center gap-2 shadow-lg shadow-blue-500/20"
118117 disabled = { loading }
118+ className = "flex-1 bg-primary hover:bg-primary/90 text-primary-foreground"
119119 >
120120 { loading ? (
121121 < >
122- < div className = "w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin" />
123- < span > Adding...</ span >
122+ < Loader2 className = "w-4 h-4 animate-spin" />
123+ Adding...
124124 </ >
125125 ) : (
126126 < >
127127 < Plus className = "w-4 h-4" />
128- < span > Add & Index </ span >
128+ Add & Index
129129 </ >
130130 ) }
131- </ motion . button >
131+ </ Button >
132132 </ div >
133133 </ form >
134134 </ motion . div >
0 commit comments