@@ -127,51 +127,18 @@ export const BeautyAssistant = () => {
127127 { /* Chat Area */ }
128128 < ScrollArea ref = { scrollRef } className = "flex-1 p-5 space-y-5 bg-white/50 backdrop-blur-md" >
129129 { messages . length === 0 && (
130- < div className = "text-center py-6 " >
131- < div className = "w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-polished-gold/20 to-transparent flex items-center justify-center border border-polished-gold/30 shadow-[0_4px_20px_-5px_rgba(212,175,55,0.3)] " >
130+ < div className = "text-center py-10 " >
131+ < div className = "w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-polished-gold/20 to-transparent flex items-center justify-center border border-polished-gold/30" >
132132 < img src = "/dr-bot-character.png" className = "w-16 h-16 object-contain" alt = "Dr. Sami Icon" />
133133 </ div >
134134 < h4 className = "text-asper-ink font-heading text-xl font-bold mb-2" >
135135 { isAr ? "استشارة مجانية" : "Private Consultation" }
136136 </ h4 >
137- < p className = "text-asper-ink/70 text-sm max-w-xs mx-auto leading-relaxed mb-6 " >
137+ < p className = "text-asper-ink/70 text-sm max-w-xs mx-auto leading-relaxed" >
138138 { isAr
139- ? "أهلاً بكِ في عيادتنا الرقمية. صفي لي حالة بشرتكِ أو اختاري مما يلي: "
140- : "Welcome to our digital clinic. Tell me about your skin concerns or select an option below: " }
139+ ? "أهلاً بكِ في عيادتنا الرقمية. صفي لي حالة بشرتكِ أو ما تبحثين عنه. "
140+ : "Welcome to our digital clinic. Tell me about your skin concerns or what you're looking for. " }
141141 </ p >
142-
143- < div className = "flex flex-col gap-2 px-4" >
144- { [ 'Routine for acne-prone skin' , 'Best anti-aging serum' , 'Daily hydration for sensitive skin' ] . map ( ( suggestion , idx ) => (
145- < button
146- key = { idx }
147- onClick = { ( ) => {
148- setInput ( suggestion ) ;
149- // We wait a tick to ensure state is updated before sending
150- setTimeout ( ( ) => {
151- const userMsg = { role : "user" , content : suggestion } ;
152- setMessages ( prev => [ ...prev , userMsg ] ) ;
153- setInput ( "" ) ;
154- setIsLoading ( true ) ;
155- supabase . functions . invoke ( 'beauty-assistant' , { body : { messages : [ userMsg ] , language } } )
156- . then ( ( { data, error} ) => {
157- if ( error ) throw error ;
158- setMessages ( prev => [ ...prev , { role : "assistant" , content : data . reply , trayProducts : data . products } ] ) ;
159- } )
160- . catch ( err => {
161- console . error ( err ) ;
162- toast . error ( ASPER_PROTOCOL . errorShort [ language === 'ar' ? 'ar' : 'en' ] ) ;
163- } )
164- . finally ( ( ) => setIsLoading ( false ) ) ;
165- } , 50 ) ;
166- } }
167- className = "text-left px-4 py-3 text-sm bg-white border border-polished-gold/20 rounded-xl text-asper-ink/80 hover:bg-polished-gold/5 hover:border-polished-gold/40 hover:text-asper-ink transition-all shadow-sm active:scale-95"
168- >
169- { isAr && idx === 0 ? "روتين للبشرة المعرضة لحب الشباب" :
170- isAr && idx === 1 ? "أفضل سيروم مقاوم للتجاعيد" :
171- isAr && idx === 2 ? "ترطيب يومي للبشرة الحساسة" : suggestion }
172- </ button >
173- ) ) }
174- </ div >
175142 </ div >
176143 ) }
177144
0 commit comments