Spaces:
Running

axeronis commited on
Commit
8ad0c07
·
1 Parent(s): 5bb4c25

feat: implement premium glass ConfirmModal and upgrade all platform dialogs

Browse files
frontend/components/ChatWindow.tsx CHANGED
@@ -16,6 +16,7 @@ import { ChatHeader } from './ChatWindow/ChatHeader'
16
  import { MessageBubble } from './ChatWindow/MessageBubble'
17
  import { MessageInput } from './ChatWindow/MessageInput'
18
  import { TypingIndicator } from './ChatWindow/TypingIndicator'
 
19
 
20
  // ============================================================================
21
  // Types
@@ -89,6 +90,7 @@ export function ChatWindow({
89
  const [isTogglingAI, setIsTogglingAI] = useState(false)
90
  const [isBookingModalOpen, setIsBookingModalOpen] = useState(false)
91
  const [isTraining, setIsTraining] = useState(false)
 
92
  const toast = useToast()
93
 
94
  const messagesEndRef = useRef<HTMLDivElement>(null)
@@ -292,7 +294,10 @@ export function ChatWindow({
292
  return
293
  }
294
 
295
- if (!confirm('Сохранить этот диалог как пример для обучения AI?')) return
 
 
 
296
 
297
  setIsTraining(true)
298
  try {
@@ -325,6 +330,7 @@ export function ChatWindow({
325
  toast.error(error.message || 'Ошибка сохранения')
326
  } finally {
327
  setIsTraining(false)
 
328
  }
329
  }
330
 
@@ -485,6 +491,17 @@ export function ChatWindow({
485
  />
486
  )}
487
  </AnimatePresence>
 
 
 
 
 
 
 
 
 
 
 
488
  </div>
489
  )
490
  }
 
16
  import { MessageBubble } from './ChatWindow/MessageBubble'
17
  import { MessageInput } from './ChatWindow/MessageInput'
18
  import { TypingIndicator } from './ChatWindow/TypingIndicator'
19
+ import { ConfirmModal } from '@/components/ui/ConfirmModal'
20
 
21
  // ============================================================================
22
  // Types
 
90
  const [isTogglingAI, setIsTogglingAI] = useState(false)
91
  const [isBookingModalOpen, setIsBookingModalOpen] = useState(false)
92
  const [isTraining, setIsTraining] = useState(false)
93
+ const [isTrainConfirmOpen, setIsTrainConfirmOpen] = useState(false)
94
  const toast = useToast()
95
 
96
  const messagesEndRef = useRef<HTMLDivElement>(null)
 
294
  return
295
  }
296
 
297
+ setIsTrainConfirmOpen(true)
298
+ }
299
+
300
+ const handleConfirmTrain = async () => {
301
 
302
  setIsTraining(true)
303
  try {
 
330
  toast.error(error.message || 'Ошибка сохранения')
331
  } finally {
332
  setIsTraining(false)
333
+ setIsTrainConfirmOpen(false)
334
  }
335
  }
336
 
 
491
  />
492
  )}
493
  </AnimatePresence>
494
+
495
+ {/* Train AI Confirmation Modal */}
496
+ <ConfirmModal
497
+ isOpen={isTrainConfirmOpen}
498
+ onClose={() => setIsTrainConfirmOpen(false)}
499
+ onConfirm={handleConfirmTrain}
500
+ title="Обучение AI"
501
+ message="Сохранить этот диалог как пример для обучения AI? Это поможет AI лучше понимать ваших клиентов."
502
+ confirmText="Обучить AI"
503
+ isLoading={isTraining}
504
+ />
505
  </div>
506
  )
507
  }
frontend/components/DemoChat.tsx CHANGED
@@ -325,8 +325,13 @@ export function DemoChat({ isOpen, onClose }: DemoChatProps) {
325
  animate={{ x: 0 }}
326
  exit={{ x: '100%' }}
327
  transition={{ type: 'spring', damping: 25, stiffness: 300 }}
328
- className="fixed right-0 top-0 h-screen w-full max-w-md bg-[#0F1019] border-l border-white/10 z-50 flex flex-col"
329
  >
 
 
 
 
 
330
  {/* Header */}
331
  <div className="flex items-center justify-between p-4 border-b border-white/10">
332
  <div className="flex items-center gap-3">
 
325
  animate={{ x: 0 }}
326
  exit={{ x: '100%' }}
327
  transition={{ type: 'spring', damping: 25, stiffness: 300 }}
328
+ className="fixed right-0 top-0 h-screen w-full max-w-md bg-[#0D0E18]/80 backdrop-blur-3xl border-l border-white/10 z-50 flex flex-col shadow-[-20px_0_50px_rgba(0,0,0,0.5)]"
329
  >
330
+ {/* Aurora Background Atmosphere */}
331
+ <div className="absolute inset-0 pointer-events-none overflow-hidden -z-10 opacity-40">
332
+ <div className="absolute top-[-10%] right-[-10%] w-[80%] h-[40%] bg-indigo-500/10 blur-[100px] rounded-full rotate-12" />
333
+ <div className="absolute bottom-[10%] left-[-10%] w-[80%] h-[40%] bg-purple-500/10 blur-[100px] rounded-full -rotate-12" />
334
+ </div>
335
  {/* Header */}
336
  <div className="flex items-center justify-between p-4 border-b border-white/10">
337
  <div className="flex items-center gap-3">
frontend/components/LeadsList.tsx CHANGED
@@ -4,7 +4,8 @@ import { useState, useEffect } from 'react'
4
  import { createPortal } from 'react-dom'
5
  import { Lead } from '@/lib/api'
6
  import { cn } from '@/lib/utils'
7
- import { Search, Flame, Inbox, CheckCircle2, MessageCircle, Mail, Linkedin, Trash2, X, Brain, RotateCcw } from 'lucide-react'
 
8
  import { useTranslation } from '@/lib/i18n'
9
 
10
  interface LeadsListProps {
@@ -105,68 +106,97 @@ export function LeadsList({
105
 
106
  return (
107
  <>
108
- {/* Delete/Reset Confirmation Modal - rendered via Portal to escape overflow:hidden */}
109
- {mounted && deleteModal && createPortal(
110
- <div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm">
111
- <div className="bg-[#1A1B26] rounded-2xl border border-white/10 p-6 max-w-md w-full shadow-2xl">
112
- <div className="flex items-center justify-between mb-4">
113
- <h3 className="text-lg font-bold text-white">{t('chats.manageChat')}</h3>
114
- <button
115
- onClick={() => { setDeleteModal(null); setClearCacheOnDelete(false) }}
116
- className="p-1 hover:bg-white/10 rounded-lg text-slate-400 hover:text-white"
117
- >
118
- <X className="w-5 h-5" />
119
- </button>
120
- </div>
121
 
122
- <p className="text-slate-400 text-sm mb-6">
123
- {t('chats.selectActionFor')} <span className="font-semibold text-white">"{deleteModal.leadName}"</span>
124
- </p>
 
 
 
 
 
 
 
 
 
125
 
126
- {/* Reset Option */}
127
- {onResetLead && (
128
- <button
129
- onClick={handleResetLead}
130
- className="w-full flex items-start gap-3 p-4 bg-indigo-500/10 rounded-xl border border-indigo-500/20 hover:border-indigo-500/40 transition-colors mb-3 text-left"
131
- >
132
- <div className="p-2 bg-indigo-500/20 rounded-lg">
133
- <RotateCcw className="w-5 h-5 text-indigo-400" />
134
- </div>
135
- <div>
136
- <div className="text-sm font-bold text-white mb-1">{t('chats.resetChat')}</div>
137
- <p className="text-xs text-slate-400">
138
- {t('chats.resetChatDesc')}
139
- </p>
140
  </div>
141
- </button>
142
- )}
143
-
144
- {/* Delete Option */}
145
- <button
146
- onClick={handleConfirmDelete}
147
- className="w-full flex items-start gap-3 p-4 bg-red-500/10 rounded-xl border border-red-500/20 hover:border-red-500/40 transition-colors text-left"
148
- >
149
- <div className="p-2 bg-red-500/20 rounded-lg">
150
- <Trash2 className="w-5 h-5 text-red-400" />
151
  </div>
152
- <div>
153
- <div className="text-sm font-bold text-white mb-1">{t('chats.deleteCompletely')}</div>
154
- <p className="text-xs text-slate-400">
155
- {t('chats.deleteChatDesc')}
156
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  </div>
158
- </button>
159
 
160
- <button
161
- onClick={() => { setDeleteModal(null); setClearCacheOnDelete(false) }}
162
- className="w-full mt-4 px-4 py-2.5 text-sm font-medium text-slate-500 hover:text-white transition-colors"
163
- >
164
- {t('common.cancel')}
165
- </button>
 
166
  </div>
167
- </div>,
168
- document.body
169
- )}
170
 
171
  <div className="flex flex-col h-full bg-[#0D0E18] border-r border-white/10">
172
  {/* Header & Search - Fixed at top via flex parent */}
 
4
  import { createPortal } from 'react-dom'
5
  import { Lead } from '@/lib/api'
6
  import { cn } from '@/lib/utils'
7
+ import { Search, Flame, Inbox, CheckCircle2, MessageCircle, Mail, Linkedin, Trash2, X, Brain, RotateCcw, AlertCircle } from 'lucide-react'
8
+ import { motion, AnimatePresence } from 'framer-motion'
9
  import { useTranslation } from '@/lib/i18n'
10
 
11
  interface LeadsListProps {
 
106
 
107
  return (
108
  <>
109
+ {/* Delete/Reset Confirmation Modal */}
110
+ <AnimatePresence>
111
+ {mounted && deleteModal && (
112
+ <div className="fixed inset-0 z-[100] flex items-center justify-center p-4">
113
+ {/* Backdrop */}
114
+ <motion.div
115
+ initial={{ opacity: 0 }}
116
+ animate={{ opacity: 1 }}
117
+ exit={{ opacity: 0 }}
118
+ onClick={() => { setDeleteModal(null); setClearCacheOnDelete(false) }}
119
+ className="absolute inset-0 bg-black/80 backdrop-blur-md"
120
+ />
 
121
 
122
+ {/* Modal Card */}
123
+ <motion.div
124
+ initial={{ opacity: 0, scale: 0.9, y: 20 }}
125
+ animate={{ opacity: 1, scale: 1, y: 0 }}
126
+ exit={{ opacity: 0, scale: 0.9, y: 20 }}
127
+ className="relative bg-[#0D0E18]/90 backdrop-blur-3xl border border-white/10 rounded-[32px] p-8 max-w-sm w-full shadow-[0_0_50px_rgba(0,0,0,0.5)] overflow-hidden"
128
+ >
129
+ {/* Aurora Atmosphere */}
130
+ <div className="absolute inset-0 pointer-events-none overflow-hidden -z-10 opacity-30">
131
+ <div className="absolute -top-24 -right-24 w-48 h-48 bg-red-500/20 blur-[60px] rounded-full" />
132
+ <div className="absolute -bottom-24 -left-24 w-48 h-48 bg-indigo-500/20 blur-[60px] rounded-full" />
133
+ </div>
134
 
135
+ <div className="flex items-center justify-between mb-6">
136
+ <div className="flex items-center gap-3">
137
+ <div className="w-10 h-10 rounded-xl bg-red-500/10 border border-red-500/20 flex items-center justify-center">
138
+ <AlertCircle className="w-6 h-6 text-red-400" />
139
+ </div>
140
+ <h3 className="text-xl font-bold text-white">Управление чатом</h3>
 
 
 
 
 
 
 
 
141
  </div>
142
+ <button
143
+ onClick={() => { setDeleteModal(null); setClearCacheOnDelete(false) }}
144
+ className="p-2 hover:bg-white/10 rounded-full text-slate-400 hover:text-white transition-all"
145
+ >
146
+ <X className="w-5 h-5" />
147
+ </button>
 
 
 
 
148
  </div>
149
+
150
+ <p className="text-slate-400 text-sm mb-8">
151
+ {t('chats.selectActionFor')} <span className="font-semibold text-white">"{deleteModal.leadName}"</span>
152
+ </p>
153
+
154
+ <div className="space-y-4">
155
+ {/* Reset Option */}
156
+ {onResetLead && (
157
+ <button
158
+ onClick={handleResetLead}
159
+ className="w-full flex items-center gap-4 p-4 bg-white/5 rounded-2xl border border-white/5 hover:border-indigo-500/30 hover:bg-indigo-500/5 transition-all text-left group"
160
+ >
161
+ <div className="w-12 h-12 flex-shrink-0 bg-indigo-500/10 rounded-xl flex items-center justify-center group-hover:scale-110 transition-transform">
162
+ <RotateCcw className="w-6 h-6 text-indigo-400" />
163
+ </div>
164
+ <div>
165
+ <div className="text-sm font-bold text-white mb-0.5">{t('chats.resetChat')}</div>
166
+ <p className="text-[11px] text-slate-500 line-clamp-1">
167
+ {t('chats.resetChatDesc')}
168
+ </p>
169
+ </div>
170
+ </button>
171
+ )}
172
+
173
+ {/* Delete Option */}
174
+ <button
175
+ onClick={handleConfirmDelete}
176
+ className="w-full flex items-center gap-4 p-4 bg-white/5 rounded-2xl border border-white/5 hover:border-red-500/30 hover:bg-red-500/5 transition-all text-left group"
177
+ >
178
+ <div className="w-12 h-12 flex-shrink-0 bg-red-500/10 rounded-xl flex items-center justify-center group-hover:scale-110 transition-transform">
179
+ <Trash2 className="w-6 h-6 text-red-400" />
180
+ </div>
181
+ <div>
182
+ <div className="text-sm font-bold text-white mb-0.5">{t('chats.deleteCompletely')}</div>
183
+ <p className="text-[11px] text-slate-500 line-clamp-1">
184
+ {t('chats.deleteChatDesc')}
185
+ </p>
186
+ </div>
187
+ </button>
188
  </div>
 
189
 
190
+ <button
191
+ onClick={() => { setDeleteModal(null); setClearCacheOnDelete(false) }}
192
+ className="w-full mt-6 py-4 text-sm font-bold text-slate-500 hover:text-white transition-colors"
193
+ >
194
+ {t('common.cancel')}
195
+ </button>
196
+ </motion.div>
197
  </div>
198
+ )}
199
+ </AnimatePresence>
 
200
 
201
  <div className="flex flex-col h-full bg-[#0D0E18] border-r border-white/10">
202
  {/* Header & Search - Fixed at top via flex parent */}
frontend/components/bookings/BookingModal.tsx CHANGED
@@ -98,18 +98,26 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
98
  return (
99
  <div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm">
100
  <motion.div
101
- initial={{ opacity: 0, scale: 0.95 }}
102
- animate={{ opacity: 1, scale: 1 }}
103
- exit={{ opacity: 0, scale: 0.95 }}
104
- className="bg-[#1E1F2E] border border-white/10 rounded-2xl w-full max-w-md overflow-hidden shadow-2xl flex flex-col max-h-[90vh]"
105
  >
 
 
 
 
 
106
  {/* Header */}
107
- <div className="px-6 py-4 border-b border-white/10 flex items-center justify-between bg-[#252636]/50">
108
- <h3 className="font-bold text-lg text-white flex items-center gap-2">
109
- <CalendarIcon className="w-5 h-5 text-indigo-500" />
110
- Записать клиента
111
- </h3>
112
- <button onClick={onClose} className="p-2 hover:bg-white/10 rounded-full transition-colors text-slate-400 hover:text-white">
 
 
 
113
  <X className="w-5 h-5" />
114
  </button>
115
  </div>
@@ -176,22 +184,22 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
176
 
177
  {/* Notes */}
178
  <div>
179
- <label className="block text-xs font-bold text-slate-400 uppercase tracking-wider mb-2">Комментарий</label>
180
  <textarea
181
  value={bookingNote}
182
  onChange={(e) => setBookingNote(e.target.value)}
183
  placeholder="О чем пойдет речь?"
184
- className="w-full p-3 bg-[#0D0E18] border border-white/10 rounded-xl text-sm focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 outline-none resize-none h-24 text-slate-200 placeholder:text-slate-600"
185
  />
186
  </div>
187
  </div>
188
 
189
  {/* Footer */}
190
- <div className="p-6 border-t border-white/10 bg-[#252636]/30">
191
  <button
192
  onClick={handleBook}
193
  disabled={!selectedDate || !selectedTime || isSubmitting}
194
- className="w-full py-3.5 bg-indigo-600 hover:bg-indigo-500 text-white font-bold rounded-xl shadow-lg shadow-indigo-900/20 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"
195
  >
196
  {isSubmitting ? (
197
  <Loader2 className="w-5 h-5 animate-spin" />
 
98
  return (
99
  <div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm">
100
  <motion.div
101
+ initial={{ opacity: 0, scale: 0.95, y: 20 }}
102
+ animate={{ opacity: 1, scale: 1, y: 0 }}
103
+ exit={{ opacity: 0, scale: 0.95, y: 20 }}
104
+ className="relative bg-[#0D0E18]/90 backdrop-blur-3xl border border-white/10 rounded-[32px] w-full max-w-md overflow-hidden shadow-[0_0_50px_rgba(0,0,0,0.5)] flex flex-col max-h-[90vh]"
105
  >
106
+ {/* Aurora Background Atmosphere */}
107
+ <div className="absolute inset-0 pointer-events-none overflow-hidden -z-10 opacity-30">
108
+ <div className="absolute top-[-10%] right-[-10%] w-[60%] h-[60%] bg-indigo-500/20 blur-[80px] rounded-full" />
109
+ <div className="absolute bottom-[-10%] left-[-10%] w-[60%] h-[60%] bg-purple-500/20 blur-[80px] rounded-full" />
110
+ </div>
111
  {/* Header */}
112
+ <div className="px-8 py-6 border-b border-white/5 flex items-center justify-between">
113
+ <div>
114
+ <h3 className="font-bold text-xl text-white flex items-center gap-2">
115
+ <CalendarIcon className="w-5 h-5 text-indigo-400" />
116
+ Записать клиента
117
+ </h3>
118
+ <p className="text-xs text-slate-400 mt-1">Выберите время для встречи</p>
119
+ </div>
120
+ <button onClick={onClose} className="p-2 hover:bg-white/10 rounded-full transition-all text-slate-400 hover:text-white border border-transparent hover:border-white/10">
121
  <X className="w-5 h-5" />
122
  </button>
123
  </div>
 
184
 
185
  {/* Notes */}
186
  <div>
187
+ <label className="block text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 ml-1">Комментарий</label>
188
  <textarea
189
  value={bookingNote}
190
  onChange={(e) => setBookingNote(e.target.value)}
191
  placeholder="О чем пойдет речь?"
192
+ className="w-full p-4 bg-white/5 border border-white/10 rounded-2xl text-sm focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 outline-none resize-none h-24 text-slate-200 placeholder:text-slate-600 transition-all"
193
  />
194
  </div>
195
  </div>
196
 
197
  {/* Footer */}
198
+ <div className="p-8 border-t border-white/5 bg-white/[0.02]">
199
  <button
200
  onClick={handleBook}
201
  disabled={!selectedDate || !selectedTime || isSubmitting}
202
+ className="w-full py-4 bg-indigo-600 hover:bg-indigo-500 text-white font-bold rounded-2xl shadow-lg shadow-indigo-900/40 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed hover:scale-[1.02] active:scale-[0.98]"
203
  >
204
  {isSubmitting ? (
205
  <Loader2 className="w-5 h-5 animate-spin" />
frontend/components/ui/ConfirmModal.tsx ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client'
2
+
3
+ import { motion, AnimatePresence } from 'framer-motion'
4
+ import { AlertCircle, X, Check, Loader2 } from 'lucide-react'
5
+ import { cn } from '@/lib/utils'
6
+
7
+ interface ConfirmModalProps {
8
+ isOpen: boolean
9
+ onClose: () => void
10
+ onConfirm: () => void
11
+ title?: string
12
+ message: string
13
+ confirmText?: string
14
+ cancelText?: string
15
+ isLoading?: boolean
16
+ variant?: 'danger' | 'primary' | 'success'
17
+ }
18
+
19
+ export function ConfirmModal({
20
+ isOpen,
21
+ onClose,
22
+ onConfirm,
23
+ title = 'Подтвердите действие',
24
+ message,
25
+ confirmText = 'Подтвердить',
26
+ cancelText = 'Отмена',
27
+ isLoading = false,
28
+ variant = 'primary'
29
+ }: ConfirmModalProps) {
30
+ return (
31
+ <AnimatePresence>
32
+ {isOpen && (
33
+ <div className="fixed inset-0 z-[999] flex items-center justify-center p-4">
34
+ {/* Backdrop */}
35
+ <motion.div
36
+ initial={{ opacity: 0 }}
37
+ animate={{ opacity: 1 }}
38
+ exit={{ opacity: 0 }}
39
+ onClick={!isLoading ? onClose : undefined}
40
+ className="absolute inset-0 bg-black/80 backdrop-blur-md"
41
+ />
42
+
43
+ {/* Modal Card */}
44
+ <motion.div
45
+ initial={{ opacity: 0, scale: 0.9, y: 20 }}
46
+ animate={{ opacity: 1, scale: 1, y: 0 }}
47
+ exit={{ opacity: 0, scale: 0.9, y: 20 }}
48
+ transition={{ type: 'spring', damping: 25, stiffness: 300 }}
49
+ className="relative w-full max-w-sm bg-[#0D0E18]/90 backdrop-blur-2xl border border-white/10 rounded-[32px] overflow-hidden shadow-[0_0_50px_rgba(0,0,0,0.5)]"
50
+ >
51
+ {/* Aurora blobs inside modal */}
52
+ <div className="absolute inset-0 pointer-events-none overflow-hidden -z-10 opacity-30">
53
+ <div className="absolute -top-24 -right-24 w-48 h-48 bg-indigo-500/20 blur-[60px] rounded-full" />
54
+ <div className="absolute -bottom-24 -left-24 w-48 h-48 bg-purple-500/20 blur-[60px] rounded-full" />
55
+ </div>
56
+
57
+ {/* Content */}
58
+ <div className="p-8">
59
+ <div className="flex justify-center mb-6">
60
+ <div className={cn(
61
+ "w-16 h-16 rounded-2xl flex items-center justify-center border",
62
+ variant === 'primary' ? "bg-indigo-500/10 border-indigo-500/30 text-indigo-400" :
63
+ variant === 'danger' ? "bg-red-500/10 border-red-500/30 text-red-400" :
64
+ "bg-emerald-500/10 border-emerald-500/30 text-emerald-400"
65
+ )}>
66
+ <AlertCircle className="w-8 h-8" />
67
+ </div>
68
+ </div>
69
+
70
+ <h3 className="text-xl font-bold text-white text-center mb-3">
71
+ {title}
72
+ </h3>
73
+ <p className="text-slate-400 text-center text-sm leading-relaxed">
74
+ {message}
75
+ </p>
76
+ </div>
77
+
78
+ {/* Actions */}
79
+ <div className="px-8 pb-8 flex flex-col gap-3">
80
+ <button
81
+ onClick={onConfirm}
82
+ disabled={isLoading}
83
+ className={cn(
84
+ "w-full py-4 rounded-2xl font-bold transition-all flex items-center justify-center gap-2 shadow-lg",
85
+ variant === 'primary' ? "bg-indigo-600 hover:bg-indigo-500 text-white shadow-indigo-900/20" :
86
+ variant === 'danger' ? "bg-red-600 hover:bg-red-500 text-white shadow-red-900/20" :
87
+ "bg-emerald-600 hover:bg-emerald-500 text-white shadow-emerald-900/20"
88
+ )}
89
+ >
90
+ {isLoading ? (
91
+ <Loader2 className="w-5 h-5 animate-spin" />
92
+ ) : (
93
+ <Check className="w-5 h-5" />
94
+ )}
95
+ {confirmText}
96
+ </button>
97
+ <button
98
+ onClick={onClose}
99
+ disabled={isLoading}
100
+ className="w-full py-4 rounded-2xl font-bold text-slate-400 hover:text-white hover:bg-white/5 border border-transparent hover:border-white/10 transition-all text-sm"
101
+ >
102
+ {cancelText}
103
+ </button>
104
+ </div>
105
+ </motion.div>
106
+ </div>
107
+ )}
108
+ </AnimatePresence>
109
+ )
110
+ }