Spaces:
Running
Running
axeronis commited on
Commit ·
720d442
1
Parent(s): ef78ff8
feat(frontend): Aurora Dark theme for chat components
Browse files- frontend/components/ChatWindow.tsx +77 -76
- frontend/components/ClientCard.tsx +43 -43
- frontend/components/StatsCard.tsx +18 -18
frontend/components/ChatWindow.tsx
CHANGED
|
@@ -180,25 +180,25 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 180 |
}
|
| 181 |
|
| 182 |
return (
|
| 183 |
-
<div className="flex flex-col h-full bg-
|
| 184 |
{/* Header */}
|
| 185 |
-
<div className="bg-
|
| 186 |
<div className="flex items-center gap-4">
|
| 187 |
{/* Desktop Toggle */}
|
| 188 |
<button
|
| 189 |
onClick={onToggleLeadsList}
|
| 190 |
-
className="hidden md:flex p-2 -ml-2 text-slate-400 hover:text-indigo-
|
| 191 |
title={isLeadsListOpen ? "Скрыть список" : "Показать список"}
|
| 192 |
>
|
| 193 |
{isLeadsListOpen ? <ArrowLeft className="w-5 h-5" /> : <MoreVertical className="w-5 h-5 rotate-90" />}
|
| 194 |
</button>
|
| 195 |
|
| 196 |
-
<button onClick={onBack} className="md:hidden p-2 -ml-2 text-slate-
|
| 197 |
<ArrowLeft className="w-5 h-5" />
|
| 198 |
</button>
|
| 199 |
|
| 200 |
<div className="flex items-center gap-3">
|
| 201 |
-
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-indigo-
|
| 202 |
{lead?.name?.charAt(0) || 'L'}
|
| 203 |
<div className={cn(
|
| 204 |
"absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-white",
|
|
@@ -208,9 +208,9 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 208 |
)} />
|
| 209 |
</div>
|
| 210 |
<div>
|
| 211 |
-
<h2 className="font-bold text-
|
| 212 |
<div className="flex items-center gap-2">
|
| 213 |
-
<span className="text-xs text-slate-
|
| 214 |
{isAnalyzing && (
|
| 215 |
<span className="flex items-center gap-1 text-[10px] text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded-full animate-pulse border border-indigo-100 font-semibold">
|
| 216 |
<Sparkles className="w-3 h-3" />
|
|
@@ -225,7 +225,7 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 225 |
<div className="flex items-center gap-3">
|
| 226 |
<button
|
| 227 |
onClick={() => setIsBookingModalOpen(true)}
|
| 228 |
-
className="hidden md:flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-semibold bg-white text-slate-
|
| 229 |
title="Записать на встречу"
|
| 230 |
>
|
| 231 |
<Calendar className="w-3.5 h-3.5 text-slate-500" />
|
|
@@ -238,8 +238,8 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 238 |
className={cn(
|
| 239 |
"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all duration-200 border shadow-sm",
|
| 240 |
isAIActive
|
| 241 |
-
? "bg-indigo-
|
| 242 |
-
: "bg-white text-slate-
|
| 243 |
)}
|
| 244 |
>
|
| 245 |
{isTogglingAI ? (
|
|
@@ -260,9 +260,9 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 260 |
</div>
|
| 261 |
|
| 262 |
{/* Stage Stepper */}
|
| 263 |
-
<div className="bg-
|
| 264 |
{loadingStages ? (
|
| 265 |
-
<div className="h-8 w-full bg-
|
| 266 |
) : (
|
| 267 |
<StageStepper
|
| 268 |
stages={stages}
|
|
@@ -274,15 +274,15 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 274 |
</div>
|
| 275 |
|
| 276 |
{/* Messages Area */}
|
| 277 |
-
<div className="flex-1 overflow-y-auto p-6 space-y-6 bg-
|
| 278 |
{isLoading ? (
|
| 279 |
<div className="flex items-center justify-center h-full">
|
| 280 |
-
<Loader2 className="w-8 h-8 animate-spin text-indigo-
|
| 281 |
</div>
|
| 282 |
) : allMessages.length === 0 ? (
|
| 283 |
-
<div className="flex flex-col items-center justify-center h-full text-slate-
|
| 284 |
-
<div className="w-16 h-16 bg-
|
| 285 |
-
<Bot className="w-8 h-8 text-slate-
|
| 286 |
</div>
|
| 287 |
<p className="text-sm font-medium">История сообщений пуста</p>
|
| 288 |
<p className="text-xs mt-1">Начните диалог первым</p>
|
|
@@ -316,7 +316,7 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 316 |
<div key={msg.id}>
|
| 317 |
{showDate && (
|
| 318 |
<div className="flex items-center justify-center my-6">
|
| 319 |
-
<span className="text-[10px] font-bold text-slate-400 bg-
|
| 320 |
{getDateLabel(msg.created_at)}
|
| 321 |
</span>
|
| 322 |
</div>
|
|
@@ -338,8 +338,8 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 338 |
)}>
|
| 339 |
{/* Avatar */}
|
| 340 |
<div className={cn(
|
| 341 |
-
"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0
|
| 342 |
-
isMe ? "bg-indigo-600 text-white" : "bg-
|
| 343 |
isSequence ? "opacity-0 w-0 overflow-hidden ml-0 mr-0" : "opacity-100"
|
| 344 |
)}>
|
| 345 |
{isMe ? (isAI ? <Bot className="w-4 h-4" /> : <User className="w-4 h-4" />) : <User className="w-4 h-4" />}
|
|
@@ -352,7 +352,7 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 352 |
"px-4 py-2.5 text-sm leading-relaxed shadow-sm relative break-words",
|
| 353 |
isMe
|
| 354 |
? "bg-indigo-600 text-white rounded-2xl rounded-br-none"
|
| 355 |
-
: "bg-
|
| 356 |
isSequence && isMe && "rounded-tr-md rounded-br-md",
|
| 357 |
isSequence && !isMe && "rounded-tl-md rounded-bl-md"
|
| 358 |
)}>
|
|
@@ -411,15 +411,15 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 411 |
</div>
|
| 412 |
|
| 413 |
{/* Input Area - Floating */}
|
| 414 |
-
<div className="p-6 bg-
|
| 415 |
<div className="max-w-4xl mx-auto relative">
|
| 416 |
<form
|
| 417 |
onSubmit={handleSendMessage}
|
| 418 |
-
className="flex items-end gap-2 bg-
|
| 419 |
>
|
| 420 |
<button
|
| 421 |
type="button"
|
| 422 |
-
className="p-2.5 text-slate-
|
| 423 |
>
|
| 424 |
<Paperclip className="w-5 h-5" />
|
| 425 |
</button>
|
|
@@ -434,14 +434,14 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 434 |
}
|
| 435 |
}}
|
| 436 |
placeholder="Напишите сообщение..."
|
| 437 |
-
className="flex-1 bg-transparent border-none focus:ring-0 resize-none max-h-32 py-2.5 text-sm text-
|
| 438 |
rows={1}
|
| 439 |
style={{ minHeight: '44px' }}
|
| 440 |
/>
|
| 441 |
|
| 442 |
<button
|
| 443 |
type="button"
|
| 444 |
-
className="p-2.5 text-slate-
|
| 445 |
>
|
| 446 |
<Smile className="w-5 h-5" />
|
| 447 |
</button>
|
|
@@ -451,62 +451,63 @@ export function ChatWindow({ messages, leadId, tenantId, conversationId, lead, c
|
|
| 451 |
disabled={!inputMessage.trim() || isSending}
|
| 452 |
className={cn(
|
| 453 |
"p-2.5 rounded-xl transition-all duration-200 shadow-sm",
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
: "bg-slate-100 text-slate-300 cursor-not-allowed"
|
| 457 |
)}
|
| 458 |
>
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
</div>
|
| 471 |
</div>
|
| 472 |
</div>
|
|
|
|
| 473 |
|
| 474 |
-
{
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
</
|
| 483 |
-
</
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
</div>
|
| 497 |
</div>
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
|
|
|
|
|
|
| 511 |
)
|
| 512 |
}
|
|
|
|
| 180 |
}
|
| 181 |
|
| 182 |
return (
|
| 183 |
+
<div className="flex flex-col h-full bg-[#0D0E18] font-['Inter'] relative">
|
| 184 |
{/* Header */}
|
| 185 |
+
<div className="bg-[#12131F] border-b border-white/10 px-6 py-3 flex items-center justify-between z-10 flex-shrink-0">
|
| 186 |
<div className="flex items-center gap-4">
|
| 187 |
{/* Desktop Toggle */}
|
| 188 |
<button
|
| 189 |
onClick={onToggleLeadsList}
|
| 190 |
+
className="hidden md:flex p-2 -ml-2 text-slate-400 hover:text-indigo-400 hover:bg-white/5 rounded-lg transition-all"
|
| 191 |
title={isLeadsListOpen ? "Скрыть список" : "Показать список"}
|
| 192 |
>
|
| 193 |
{isLeadsListOpen ? <ArrowLeft className="w-5 h-5" /> : <MoreVertical className="w-5 h-5 rotate-90" />}
|
| 194 |
</button>
|
| 195 |
|
| 196 |
+
<button onClick={onBack} className="md:hidden p-2 -ml-2 text-slate-400 hover:text-white">
|
| 197 |
<ArrowLeft className="w-5 h-5" />
|
| 198 |
</button>
|
| 199 |
|
| 200 |
<div className="flex items-center gap-3">
|
| 201 |
+
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-indigo-600/30 to-purple-600/30 flex items-center justify-center text-indigo-400 font-bold text-sm border border-indigo-500/30 relative shadow-sm">
|
| 202 |
{lead?.name?.charAt(0) || 'L'}
|
| 203 |
<div className={cn(
|
| 204 |
"absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-white",
|
|
|
|
| 208 |
)} />
|
| 209 |
</div>
|
| 210 |
<div>
|
| 211 |
+
<h2 className="font-bold text-white text-sm">{lead?.name || 'Лид'}</h2>
|
| 212 |
<div className="flex items-center gap-2">
|
| 213 |
+
<span className="text-xs text-slate-400 font-medium">{(lead as any)?.channel_source || 'Unknown'}</span>
|
| 214 |
{isAnalyzing && (
|
| 215 |
<span className="flex items-center gap-1 text-[10px] text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded-full animate-pulse border border-indigo-100 font-semibold">
|
| 216 |
<Sparkles className="w-3 h-3" />
|
|
|
|
| 225 |
<div className="flex items-center gap-3">
|
| 226 |
<button
|
| 227 |
onClick={() => setIsBookingModalOpen(true)}
|
| 228 |
+
className="hidden md:flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-semibold bg-white/5 text-slate-300 border border-white/10 hover:bg-white/10 transition-all"
|
| 229 |
title="Записать на встречу"
|
| 230 |
>
|
| 231 |
<Calendar className="w-3.5 h-3.5 text-slate-500" />
|
|
|
|
| 238 |
className={cn(
|
| 239 |
"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all duration-200 border shadow-sm",
|
| 240 |
isAIActive
|
| 241 |
+
? "bg-indigo-500/20 text-indigo-300 border-indigo-500/30 hover:bg-indigo-500/30"
|
| 242 |
+
: "bg-white/5 text-slate-400 border-white/10 hover:bg-white/10"
|
| 243 |
)}
|
| 244 |
>
|
| 245 |
{isTogglingAI ? (
|
|
|
|
| 260 |
</div>
|
| 261 |
|
| 262 |
{/* Stage Stepper */}
|
| 263 |
+
<div className="bg-[#12131F] border-b border-white/10 px-6 py-2 overflow-x-auto scrollbar-hide flex-shrink-0">
|
| 264 |
{loadingStages ? (
|
| 265 |
+
<div className="h-8 w-full bg-white/5 animate-pulse rounded-lg" />
|
| 266 |
) : (
|
| 267 |
<StageStepper
|
| 268 |
stages={stages}
|
|
|
|
| 274 |
</div>
|
| 275 |
|
| 276 |
{/* Messages Area */}
|
| 277 |
+
<div className="flex-1 overflow-y-auto p-6 space-y-6 bg-[#0D0E18] scrollbar-thin scrollbar-thumb-white/10">
|
| 278 |
{isLoading ? (
|
| 279 |
<div className="flex items-center justify-center h-full">
|
| 280 |
+
<Loader2 className="w-8 h-8 animate-spin text-indigo-500" />
|
| 281 |
</div>
|
| 282 |
) : allMessages.length === 0 ? (
|
| 283 |
+
<div className="flex flex-col items-center justify-center h-full text-slate-500">
|
| 284 |
+
<div className="w-16 h-16 bg-[#12131F] rounded-full flex items-center justify-center border border-white/10 mb-4">
|
| 285 |
+
<Bot className="w-8 h-8 text-slate-600" />
|
| 286 |
</div>
|
| 287 |
<p className="text-sm font-medium">История сообщений пуста</p>
|
| 288 |
<p className="text-xs mt-1">Начните диалог первым</p>
|
|
|
|
| 316 |
<div key={msg.id}>
|
| 317 |
{showDate && (
|
| 318 |
<div className="flex items-center justify-center my-6">
|
| 319 |
+
<span className="text-[10px] font-bold text-slate-400 bg-white/10 px-3 py-1 rounded-full uppercase tracking-wide">
|
| 320 |
{getDateLabel(msg.created_at)}
|
| 321 |
</span>
|
| 322 |
</div>
|
|
|
|
| 338 |
)}>
|
| 339 |
{/* Avatar */}
|
| 340 |
<div className={cn(
|
| 341 |
+
"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 mt-auto mb-1 transition-opacity",
|
| 342 |
+
isMe ? "bg-indigo-600 text-white" : "bg-[#12131F] text-slate-400 border border-white/10",
|
| 343 |
isSequence ? "opacity-0 w-0 overflow-hidden ml-0 mr-0" : "opacity-100"
|
| 344 |
)}>
|
| 345 |
{isMe ? (isAI ? <Bot className="w-4 h-4" /> : <User className="w-4 h-4" />) : <User className="w-4 h-4" />}
|
|
|
|
| 352 |
"px-4 py-2.5 text-sm leading-relaxed shadow-sm relative break-words",
|
| 353 |
isMe
|
| 354 |
? "bg-indigo-600 text-white rounded-2xl rounded-br-none"
|
| 355 |
+
: "bg-[#12131F] text-slate-200 border border-white/10 rounded-2xl rounded-bl-none",
|
| 356 |
isSequence && isMe && "rounded-tr-md rounded-br-md",
|
| 357 |
isSequence && !isMe && "rounded-tl-md rounded-bl-md"
|
| 358 |
)}>
|
|
|
|
| 411 |
</div>
|
| 412 |
|
| 413 |
{/* Input Area - Floating */}
|
| 414 |
+
<div className="p-6 bg-[#0D0E18] flex-shrink-0">
|
| 415 |
<div className="max-w-4xl mx-auto relative">
|
| 416 |
<form
|
| 417 |
onSubmit={handleSendMessage}
|
| 418 |
+
className="flex items-end gap-2 bg-[#12131F] p-2 rounded-2xl border border-white/10 focus-within:ring-2 focus-within:ring-indigo-500/30 transition-all"
|
| 419 |
>
|
| 420 |
<button
|
| 421 |
type="button"
|
| 422 |
+
className="p-2.5 text-slate-500 hover:text-indigo-400 hover:bg-white/5 rounded-xl transition-colors"
|
| 423 |
>
|
| 424 |
<Paperclip className="w-5 h-5" />
|
| 425 |
</button>
|
|
|
|
| 434 |
}
|
| 435 |
}}
|
| 436 |
placeholder="Напишите сообщение..."
|
| 437 |
+
className="flex-1 bg-transparent border-none focus:ring-0 resize-none max-h-32 py-2.5 text-sm text-white placeholder:text-slate-500"
|
| 438 |
rows={1}
|
| 439 |
style={{ minHeight: '44px' }}
|
| 440 |
/>
|
| 441 |
|
| 442 |
<button
|
| 443 |
type="button"
|
| 444 |
+
className="p-2.5 text-slate-500 hover:text-indigo-400 hover:bg-white/5 rounded-xl transition-colors"
|
| 445 |
>
|
| 446 |
<Smile className="w-5 h-5" />
|
| 447 |
</button>
|
|
|
|
| 451 |
disabled={!inputMessage.trim() || isSending}
|
| 452 |
className={cn(
|
| 453 |
"p-2.5 rounded-xl transition-all duration-200 shadow-sm",
|
| 454 |
+
? "bg-indigo-600 text-white hover:bg-indigo-500 hover:scale-105 active:scale-95"
|
| 455 |
+
: "bg-white/5 text-slate-500 cursor-not-allowed"
|
|
|
|
| 456 |
)}
|
| 457 |
>
|
| 458 |
+
{isSending ? (
|
| 459 |
+
<Loader2 className="w-5 h-5 animate-spin" />
|
| 460 |
+
) : (
|
| 461 |
+
<Send className="w-5 h-5" />
|
| 462 |
+
)}
|
| 463 |
+
</button>
|
| 464 |
+
</form>
|
| 465 |
+
<div className="text-center mt-2">
|
| 466 |
+
<p className="text-[10px] text-slate-400 font-medium">
|
| 467 |
+
Enter для отправки • Shift + Enter для переноса
|
| 468 |
+
</p>
|
|
|
|
| 469 |
</div>
|
| 470 |
</div>
|
| 471 |
+
</div>
|
| 472 |
|
| 473 |
+
{
|
| 474 |
+
isMobileDrawerOpen && (
|
| 475 |
+
<div className="fixed inset-0 z-50 md:hidden">
|
| 476 |
+
<div className="absolute inset-0 bg-black/60 backdrop-blur-sm" onClick={() => setIsMobileDrawerOpen(false)} />
|
| 477 |
+
<div className="absolute right-0 top-0 bottom-0 w-[85%] bg-[#12131F] shadow-2xl animate-in slide-in-from-right duration-300">
|
| 478 |
+
<div className="p-4 border-b border-white/10 flex items-center justify-between">
|
| 479 |
+
<h3 className="font-bold text-white">Инфо о лиде</h3>
|
| 480 |
+
<button onClick={() => setIsMobileDrawerOpen(false)} className="p-2 hover:bg-white/10 rounded-full">
|
| 481 |
+
<X className="w-5 h-5 text-slate-400" />
|
| 482 |
+
</button>
|
| 483 |
+
</div>
|
| 484 |
+
<div className="h-full overflow-y-auto pb-20">
|
| 485 |
+
{lead && (
|
| 486 |
+
<ClientCard
|
| 487 |
+
lead={lead}
|
| 488 |
+
onTakeover={onTakeover || (() => { })}
|
| 489 |
+
isAnalyzing={isAnalyzing}
|
| 490 |
+
onRefresh={onRefresh || (() => { })}
|
| 491 |
+
conversationId={conversationId}
|
| 492 |
+
tenantId={tenantId}
|
| 493 |
+
/>
|
| 494 |
+
)}
|
| 495 |
</div>
|
| 496 |
</div>
|
| 497 |
+
</div>
|
| 498 |
+
)
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
<AnimatePresence>
|
| 502 |
+
{isBookingModalOpen && leadId && (
|
| 503 |
+
<BookingModal
|
| 504 |
+
isOpen={isBookingModalOpen}
|
| 505 |
+
onClose={() => setIsBookingModalOpen(false)}
|
| 506 |
+
leadId={leadId}
|
| 507 |
+
leadName={lead?.name || undefined}
|
| 508 |
+
/>
|
| 509 |
+
)}
|
| 510 |
+
</AnimatePresence>
|
| 511 |
+
</div >
|
| 512 |
)
|
| 513 |
}
|
frontend/components/ClientCard.tsx
CHANGED
|
@@ -133,18 +133,18 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 133 |
}
|
| 134 |
|
| 135 |
return (
|
| 136 |
-
<div className="h-full flex flex-col bg-
|
| 137 |
{/* Header */}
|
| 138 |
-
<div className="p-5 border-b border-
|
| 139 |
<div className="flex items-center gap-3">
|
| 140 |
-
<div className="w-10 h-10 rounded-xl bg-indigo-
|
| 141 |
<Brain className="w-5 h-5" />
|
| 142 |
</div>
|
| 143 |
<div>
|
| 144 |
-
<h2 className="font-bold text-
|
| 145 |
-
<p className="text-[10px] text-slate-
|
| 146 |
{currentStage && (
|
| 147 |
-
<span className="flex items-center gap-1 px-2 py-0.5 bg-indigo-
|
| 148 |
<Target className="w-3 h-3" />
|
| 149 |
{currentStage.name}
|
| 150 |
</span>
|
|
@@ -157,7 +157,7 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 157 |
<button
|
| 158 |
onClick={handleReanalyze}
|
| 159 |
disabled={isReanalyzing || isAnalyzing}
|
| 160 |
-
className="flex items-center gap-1.5 px-3 py-1.5 bg-white border border-
|
| 161 |
>
|
| 162 |
<Brain className={cn("w-3 h-3", (isReanalyzing || isAnalyzing) && "animate-pulse")} />
|
| 163 |
<span>{isReanalyzing ? 'Анализ...' : 'Анализ'}</span>
|
|
@@ -172,7 +172,7 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 172 |
<stop offset="100%" stopColor={data.heat_score >= 80 ? '#f87171' : data.heat_score >= 50 ? '#fbbf24' : '#60a5fa'} />
|
| 173 |
</linearGradient>
|
| 174 |
</defs>
|
| 175 |
-
<circle cx="24" cy="24" r="20" stroke="
|
| 176 |
<circle
|
| 177 |
cx="24" cy="24" r="20"
|
| 178 |
stroke="url(#scoreGradient)"
|
|
@@ -192,80 +192,80 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 192 |
</div>
|
| 193 |
|
| 194 |
{/* Content */}
|
| 195 |
-
<div className="flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin scrollbar-thumb-
|
| 196 |
|
| 197 |
{/* Action Buttons - Removed non-functional buttons */}
|
| 198 |
|
| 199 |
{/* Profile Info */}
|
| 200 |
-
<div className="bg-
|
| 201 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-2">Профиль клиента</h3>
|
| 202 |
<div className="space-y-2">
|
| 203 |
-
<div className="flex items-center justify-between p-2 bg-
|
| 204 |
<div className="flex items-center gap-2">
|
| 205 |
-
<UserIcon className="w-3.5 h-3.5 text-slate-
|
| 206 |
-
<span className="text-xs font-medium text-slate-
|
| 207 |
</div>
|
| 208 |
-
<span className="text-xs font-bold text-
|
| 209 |
</div>
|
| 210 |
|
| 211 |
-
<div className="flex items-center justify-between p-2 bg-
|
| 212 |
<div className="flex items-center gap-2">
|
| 213 |
-
<MapPin className="w-3.5 h-3.5 text-slate-
|
| 214 |
-
<span className="text-xs font-medium text-slate-
|
| 215 |
</div>
|
| 216 |
-
<span className="text-xs font-bold text-
|
| 217 |
</div>
|
| 218 |
|
| 219 |
-
<div className="flex items-center justify-between p-2 bg-
|
| 220 |
<div className="flex items-center gap-2">
|
| 221 |
-
<Briefcase className="w-3.5 h-3.5 text-slate-
|
| 222 |
-
<span className="text-xs font-medium text-slate-
|
| 223 |
</div>
|
| 224 |
-
<span className="text-xs font-bold text-
|
| 225 |
</div>
|
| 226 |
</div>
|
| 227 |
</div>
|
| 228 |
|
| 229 |
{/* Key Metrics Grid */}
|
| 230 |
-
<div className="bg-
|
| 231 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-2">Ключевые данные</h3>
|
| 232 |
<div className="grid grid-cols-2 gap-3">
|
| 233 |
-
<div className="p-2.5 bg-
|
| 234 |
<div className="flex items-center gap-1.5 mb-1">
|
| 235 |
-
<Target className="w-3 h-3 text-indigo-
|
| 236 |
<span className="text-[10px] font-medium text-slate-500">Намерение</span>
|
| 237 |
</div>
|
| 238 |
-
<p className="text-xs font-semibold text-
|
| 239 |
</div>
|
| 240 |
|
| 241 |
-
<div className="p-2.5 bg-
|
| 242 |
<div className="flex items-center gap-1.5 mb-1">
|
| 243 |
-
<DollarSign className="w-3 h-3 text-emerald-
|
| 244 |
<span className="text-[10px] font-medium text-slate-500">Бюджет</span>
|
| 245 |
</div>
|
| 246 |
-
<p className="text-xs font-semibold text-
|
| 247 |
</div>
|
| 248 |
|
| 249 |
-
<div className="p-2.5 bg-
|
| 250 |
<div className="flex items-center gap-1.5 mb-1">
|
| 251 |
-
<UserIcon className="w-3 h-3 text-blue-
|
| 252 |
<span className="text-[10px] font-medium text-slate-500">ЛПР</span>
|
| 253 |
</div>
|
| 254 |
-
<p className="text-xs font-semibold text-
|
| 255 |
</div>
|
| 256 |
|
| 257 |
-
<div className="p-2.5 bg-
|
| 258 |
<div className="flex items-center gap-1.5 mb-1">
|
| 259 |
-
<Clock className="w-3 h-3 text-amber-
|
| 260 |
<span className="text-[10px] font-medium text-slate-500">Сроки</span>
|
| 261 |
</div>
|
| 262 |
-
<p className="text-xs font-semibold text-
|
| 263 |
</div>
|
| 264 |
</div>
|
| 265 |
</div>
|
| 266 |
|
| 267 |
{/* Psychotype */}
|
| 268 |
-
<div className={cn("p-4 rounded-xl border
|
| 269 |
<div className={cn("w-10 h-10 rounded-full flex items-center justify-center shadow-sm ring-2 ring-white", psychotype.bg, psychotype.color)}>
|
| 270 |
<psychotype.icon className="w-5 h-5" />
|
| 271 |
</div>
|
|
@@ -278,14 +278,14 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 278 |
{/* Pain Points & Objections */}
|
| 279 |
<div className="space-y-3">
|
| 280 |
{data.pain_points.length > 0 && (
|
| 281 |
-
<div className="bg-
|
| 282 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
| 283 |
-
<AlertCircle className="w-3.5 h-3.5 text-red-
|
| 284 |
Боли клиента
|
| 285 |
</h3>
|
| 286 |
<div className="flex flex-wrap gap-2">
|
| 287 |
{data.pain_points.map((point: string, i: number) => (
|
| 288 |
-
<span key={i} className="px-2.5 py-1.5 bg-red-
|
| 289 |
{point}
|
| 290 |
</span>
|
| 291 |
))}
|
|
@@ -294,14 +294,14 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 294 |
)}
|
| 295 |
|
| 296 |
{data.objections.length > 0 && (
|
| 297 |
-
<div className="bg-
|
| 298 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
| 299 |
-
<AlertTriangle className="w-3.5 h-3.5 text-amber-
|
| 300 |
Возражения
|
| 301 |
</h3>
|
| 302 |
<div className="flex flex-wrap gap-2">
|
| 303 |
{data.objections.map((obj: string, i: number) => (
|
| 304 |
-
<span key={i} className="px-2.5 py-1.5 bg-amber-
|
| 305 |
{obj}
|
| 306 |
</span>
|
| 307 |
))}
|
|
@@ -387,7 +387,7 @@ export function ClientCard({ lead, onTakeover, isAnalyzing, onRefresh, conversat
|
|
| 387 |
<div className="pt-2 mt-auto">
|
| 388 |
<button
|
| 389 |
onClick={onTakeover}
|
| 390 |
-
className="w-full py-3 bg-
|
| 391 |
>
|
| 392 |
<UserIcon className="w-4 h-4 group-hover:scale-110 transition-transform" />
|
| 393 |
Взять диалог на себя
|
|
|
|
| 133 |
}
|
| 134 |
|
| 135 |
return (
|
| 136 |
+
<div className="h-full flex flex-col bg-[#0D0E18] font-['Inter'] border-l border-white/10">
|
| 137 |
{/* Header */}
|
| 138 |
+
<div className="p-5 border-b border-white/10 flex items-center justify-between bg-[#12131F] sticky top-0 z-10">
|
| 139 |
<div className="flex items-center gap-3">
|
| 140 |
+
<div className="w-10 h-10 rounded-xl bg-indigo-500/20 flex items-center justify-center text-indigo-400 border border-indigo-500/30">
|
| 141 |
<Brain className="w-5 h-5" />
|
| 142 |
</div>
|
| 143 |
<div>
|
| 144 |
+
<h2 className="font-bold text-white text-sm">AI Summary</h2>
|
| 145 |
+
<p className="text-[10px] text-slate-400 font-medium">Анализ диалога</p>
|
| 146 |
{currentStage && (
|
| 147 |
+
<span className="flex items-center gap-1 px-2 py-0.5 bg-indigo-500/20 border border-indigo-500/30 rounded-md text-[10px] font-semibold text-indigo-400">
|
| 148 |
<Target className="w-3 h-3" />
|
| 149 |
{currentStage.name}
|
| 150 |
</span>
|
|
|
|
| 157 |
<button
|
| 158 |
onClick={handleReanalyze}
|
| 159 |
disabled={isReanalyzing || isAnalyzing}
|
| 160 |
+
className="flex items-center gap-1.5 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-[10px] font-bold text-slate-300 hover:text-indigo-400 hover:border-indigo-500/30 hover:bg-indigo-500/10 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed"
|
| 161 |
>
|
| 162 |
<Brain className={cn("w-3 h-3", (isReanalyzing || isAnalyzing) && "animate-pulse")} />
|
| 163 |
<span>{isReanalyzing ? 'Анализ...' : 'Анализ'}</span>
|
|
|
|
| 172 |
<stop offset="100%" stopColor={data.heat_score >= 80 ? '#f87171' : data.heat_score >= 50 ? '#fbbf24' : '#60a5fa'} />
|
| 173 |
</linearGradient>
|
| 174 |
</defs>
|
| 175 |
+
<circle cx="24" cy="24" r="20" stroke="rgba(255,255,255,0.1)" strokeWidth="4" fill="none" />
|
| 176 |
<circle
|
| 177 |
cx="24" cy="24" r="20"
|
| 178 |
stroke="url(#scoreGradient)"
|
|
|
|
| 192 |
</div>
|
| 193 |
|
| 194 |
{/* Content */}
|
| 195 |
+
<div className="flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin scrollbar-thumb-white/10">
|
| 196 |
|
| 197 |
{/* Action Buttons - Removed non-functional buttons */}
|
| 198 |
|
| 199 |
{/* Profile Info */}
|
| 200 |
+
<div className="bg-[#12131F] rounded-xl border border-white/10 p-4 space-y-3">
|
| 201 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-2">Профиль клиента</h3>
|
| 202 |
<div className="space-y-2">
|
| 203 |
+
<div className="flex items-center justify-between p-2 bg-white/5 rounded-lg border border-white/5">
|
| 204 |
<div className="flex items-center gap-2">
|
| 205 |
+
<UserIcon className="w-3.5 h-3.5 text-slate-500" />
|
| 206 |
+
<span className="text-xs font-medium text-slate-400">Имя</span>
|
| 207 |
</div>
|
| 208 |
+
<span className="text-xs font-bold text-white">{lead.name || 'Не указано'}</span>
|
| 209 |
</div>
|
| 210 |
|
| 211 |
+
<div className="flex items-center justify-between p-2 bg-white/5 rounded-lg border border-white/5">
|
| 212 |
<div className="flex items-center gap-2">
|
| 213 |
+
<MapPin className="w-3.5 h-3.5 text-slate-500" />
|
| 214 |
+
<span className="text-xs font-medium text-slate-400">Локация</span>
|
| 215 |
</div>
|
| 216 |
+
<span className="text-xs font-bold text-white">{cleanValue(summary.location, 'Не определено')}</span>
|
| 217 |
</div>
|
| 218 |
|
| 219 |
+
<div className="flex items-center justify-between p-2 bg-white/5 rounded-lg border border-white/5">
|
| 220 |
<div className="flex items-center gap-2">
|
| 221 |
+
<Briefcase className="w-3.5 h-3.5 text-slate-500" />
|
| 222 |
+
<span className="text-xs font-medium text-slate-400">Сфера</span>
|
| 223 |
</div>
|
| 224 |
+
<span className="text-xs font-bold text-white">{cleanValue(summary.industry, 'Не определено')}</span>
|
| 225 |
</div>
|
| 226 |
</div>
|
| 227 |
</div>
|
| 228 |
|
| 229 |
{/* Key Metrics Grid */}
|
| 230 |
+
<div className="bg-[#12131F] rounded-xl border border-white/10 p-4 space-y-3">
|
| 231 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-2">Ключевые данные</h3>
|
| 232 |
<div className="grid grid-cols-2 gap-3">
|
| 233 |
+
<div className="p-2.5 bg-white/5 rounded-lg border border-white/5">
|
| 234 |
<div className="flex items-center gap-1.5 mb-1">
|
| 235 |
+
<Target className="w-3 h-3 text-indigo-400" />
|
| 236 |
<span className="text-[10px] font-medium text-slate-500">Намерение</span>
|
| 237 |
</div>
|
| 238 |
+
<p className="text-xs font-semibold text-white line-clamp-2 leading-tight" title={data.intent}>{data.intent}</p>
|
| 239 |
</div>
|
| 240 |
|
| 241 |
+
<div className="p-2.5 bg-white/5 rounded-lg border border-white/5">
|
| 242 |
<div className="flex items-center gap-1.5 mb-1">
|
| 243 |
+
<DollarSign className="w-3 h-3 text-emerald-400" />
|
| 244 |
<span className="text-[10px] font-medium text-slate-500">Бюджет</span>
|
| 245 |
</div>
|
| 246 |
+
<p className="text-xs font-semibold text-white leading-tight">{data.budget}</p>
|
| 247 |
</div>
|
| 248 |
|
| 249 |
+
<div className="p-2.5 bg-white/5 rounded-lg border border-white/5">
|
| 250 |
<div className="flex items-center gap-1.5 mb-1">
|
| 251 |
+
<UserIcon className="w-3 h-3 text-blue-400" />
|
| 252 |
<span className="text-[10px] font-medium text-slate-500">ЛПР</span>
|
| 253 |
</div>
|
| 254 |
+
<p className="text-xs font-semibold text-white leading-tight">{data.authority}</p>
|
| 255 |
</div>
|
| 256 |
|
| 257 |
+
<div className="p-2.5 bg-white/5 rounded-lg border border-white/5">
|
| 258 |
<div className="flex items-center gap-1.5 mb-1">
|
| 259 |
+
<Clock className="w-3 h-3 text-amber-400" />
|
| 260 |
<span className="text-[10px] font-medium text-slate-500">Сроки</span>
|
| 261 |
</div>
|
| 262 |
+
<p className="text-xs font-semibold text-white leading-tight">{data.timeline}</p>
|
| 263 |
</div>
|
| 264 |
</div>
|
| 265 |
</div>
|
| 266 |
|
| 267 |
{/* Psychotype */}
|
| 268 |
+
<div className={cn("p-4 rounded-xl border flex items-center gap-4 transition-all bg-[#12131F]", psychotype.color.replace('text-', 'border-').replace('600', '500/30'))}>
|
| 269 |
<div className={cn("w-10 h-10 rounded-full flex items-center justify-center shadow-sm ring-2 ring-white", psychotype.bg, psychotype.color)}>
|
| 270 |
<psychotype.icon className="w-5 h-5" />
|
| 271 |
</div>
|
|
|
|
| 278 |
{/* Pain Points & Objections */}
|
| 279 |
<div className="space-y-3">
|
| 280 |
{data.pain_points.length > 0 && (
|
| 281 |
+
<div className="bg-[#12131F] rounded-xl border border-white/10 p-4">
|
| 282 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
| 283 |
+
<AlertCircle className="w-3.5 h-3.5 text-red-400" />
|
| 284 |
Боли клиента
|
| 285 |
</h3>
|
| 286 |
<div className="flex flex-wrap gap-2">
|
| 287 |
{data.pain_points.map((point: string, i: number) => (
|
| 288 |
+
<span key={i} className="px-2.5 py-1.5 bg-red-500/20 text-red-400 text-[10px] font-semibold rounded-lg border border-red-500/30 leading-tight">
|
| 289 |
{point}
|
| 290 |
</span>
|
| 291 |
))}
|
|
|
|
| 294 |
)}
|
| 295 |
|
| 296 |
{data.objections.length > 0 && (
|
| 297 |
+
<div className="bg-[#12131F] rounded-xl border border-white/10 p-4">
|
| 298 |
<h3 className="text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
| 299 |
+
<AlertTriangle className="w-3.5 h-3.5 text-amber-400" />
|
| 300 |
Возражения
|
| 301 |
</h3>
|
| 302 |
<div className="flex flex-wrap gap-2">
|
| 303 |
{data.objections.map((obj: string, i: number) => (
|
| 304 |
+
<span key={i} className="px-2.5 py-1.5 bg-amber-500/20 text-amber-400 text-[10px] font-semibold rounded-lg border border-amber-500/30 leading-tight">
|
| 305 |
{obj}
|
| 306 |
</span>
|
| 307 |
))}
|
|
|
|
| 387 |
<div className="pt-2 mt-auto">
|
| 388 |
<button
|
| 389 |
onClick={onTakeover}
|
| 390 |
+
className="w-full py-3 bg-indigo-600 text-white text-xs font-bold rounded-xl hover:bg-indigo-500 transition-all shadow-lg shadow-indigo-500/20 flex items-center justify-center gap-2 group"
|
| 391 |
>
|
| 392 |
<UserIcon className="w-4 h-4 group-hover:scale-110 transition-transform" />
|
| 393 |
Взять диалог на себя
|
frontend/components/StatsCard.tsx
CHANGED
|
@@ -16,49 +16,49 @@ interface StatsCardProps {
|
|
| 16 |
iconBgColor?: string
|
| 17 |
}
|
| 18 |
|
| 19 |
-
export function StatsCard({
|
| 20 |
-
title,
|
| 21 |
-
value,
|
| 22 |
-
icon: Icon,
|
| 23 |
-
trend,
|
| 24 |
className,
|
| 25 |
iconColor = 'text-blue-600',
|
| 26 |
iconBgColor = 'bg-blue-50'
|
| 27 |
}: StatsCardProps) {
|
| 28 |
return (
|
| 29 |
<div className={cn(
|
| 30 |
-
"group relative bg-
|
| 31 |
className
|
| 32 |
)}>
|
| 33 |
{/* Premium gradient overlay */}
|
| 34 |
-
<div className="absolute inset-0 bg-gradient-to-br from-
|
| 35 |
-
|
| 36 |
<div className="relative flex items-start justify-between">
|
| 37 |
<div className="flex-1">
|
| 38 |
-
<p className="text-xs font-semibold text-slate-
|
| 39 |
-
<p className="text-4xl font-bold text-
|
| 40 |
{trend && (
|
| 41 |
<div className="flex items-center gap-2 mt-4">
|
| 42 |
<div className={cn(
|
| 43 |
"flex items-center gap-1 text-xs font-bold px-2.5 py-1 rounded-lg",
|
| 44 |
-
trend.isPositive
|
| 45 |
-
? "bg-emerald-
|
| 46 |
-
: "bg-red-
|
| 47 |
)}>
|
| 48 |
<span>{trend.isPositive ? '↑' : '↓'}</span>
|
| 49 |
<span>{Math.abs(trend.value)}%</span>
|
| 50 |
</div>
|
| 51 |
-
<span className="text-xs text-slate-
|
| 52 |
</div>
|
| 53 |
)}
|
| 54 |
</div>
|
| 55 |
-
|
| 56 |
{/* Icon with modern styling */}
|
| 57 |
<div className={cn(
|
| 58 |
-
"p-3.5 rounded-xl transition-all duration-300 group-hover:scale-110
|
| 59 |
-
iconBgColor
|
| 60 |
)}>
|
| 61 |
-
<Icon className={cn("w-5 h-5", iconColor)} strokeWidth={2.5} />
|
| 62 |
</div>
|
| 63 |
</div>
|
| 64 |
</div>
|
|
|
|
| 16 |
iconBgColor?: string
|
| 17 |
}
|
| 18 |
|
| 19 |
+
export function StatsCard({
|
| 20 |
+
title,
|
| 21 |
+
value,
|
| 22 |
+
icon: Icon,
|
| 23 |
+
trend,
|
| 24 |
className,
|
| 25 |
iconColor = 'text-blue-600',
|
| 26 |
iconBgColor = 'bg-blue-50'
|
| 27 |
}: StatsCardProps) {
|
| 28 |
return (
|
| 29 |
<div className={cn(
|
| 30 |
+
"group relative bg-[#12131F] rounded-2xl border border-white/10 p-6 transition-all duration-300 hover:border-indigo-500/30 hover:-translate-y-0.5 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]",
|
| 31 |
className
|
| 32 |
)}>
|
| 33 |
{/* Premium gradient overlay */}
|
| 34 |
+
<div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/3 group-hover:to-pink-500/5 transition-all duration-500 rounded-2xl" />
|
| 35 |
+
|
| 36 |
<div className="relative flex items-start justify-between">
|
| 37 |
<div className="flex-1">
|
| 38 |
+
<p className="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-2">{title}</p>
|
| 39 |
+
<p className="text-4xl font-bold text-white tracking-tight">{value}</p>
|
| 40 |
{trend && (
|
| 41 |
<div className="flex items-center gap-2 mt-4">
|
| 42 |
<div className={cn(
|
| 43 |
"flex items-center gap-1 text-xs font-bold px-2.5 py-1 rounded-lg",
|
| 44 |
+
trend.isPositive
|
| 45 |
+
? "bg-emerald-500/20 text-emerald-400 ring-1 ring-emerald-500/30"
|
| 46 |
+
: "bg-red-500/20 text-red-400 ring-1 ring-red-500/30"
|
| 47 |
)}>
|
| 48 |
<span>{trend.isPositive ? '↑' : '↓'}</span>
|
| 49 |
<span>{Math.abs(trend.value)}%</span>
|
| 50 |
</div>
|
| 51 |
+
<span className="text-xs text-slate-500 font-medium">по сравнению с прошлым месяцем</span>
|
| 52 |
</div>
|
| 53 |
)}
|
| 54 |
</div>
|
| 55 |
+
|
| 56 |
{/* Icon with modern styling */}
|
| 57 |
<div className={cn(
|
| 58 |
+
"p-3.5 rounded-xl transition-all duration-300 group-hover:scale-110 border border-white/10",
|
| 59 |
+
iconBgColor.replace('bg-blue-50', 'bg-indigo-500/20').replace('bg-', 'bg-')
|
| 60 |
)}>
|
| 61 |
+
<Icon className={cn("w-5 h-5", iconColor.replace('text-blue-600', 'text-indigo-400'))} strokeWidth={2.5} />
|
| 62 |
</div>
|
| 63 |
</div>
|
| 64 |
</div>
|