Spaces:
Running
Running
axeronis commited on
Commit ·
95fcbcb
1
Parent(s): 8ad0c07
fix: optimize booking modal performance and replace native alerts with premium success view
Browse files
frontend/components/LeadsList.tsx
CHANGED
|
@@ -258,7 +258,14 @@ export function LeadsList({
|
|
| 258 |
</div>
|
| 259 |
|
| 260 |
{/* List Content - with bottom padding for mobile nav */}
|
| 261 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
{isLoading ? (
|
| 263 |
// Skeleton Loading
|
| 264 |
<div className="space-y-2 p-2">
|
|
|
|
| 258 |
</div>
|
| 259 |
|
| 260 |
{/* List Content - with bottom padding for mobile nav */}
|
| 261 |
+
<div
|
| 262 |
+
className="flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 p-2 pb-16 md:pb-2 space-y-1"
|
| 263 |
+
style={{
|
| 264 |
+
willChange: 'transform',
|
| 265 |
+
transform: 'translateZ(0)',
|
| 266 |
+
WebkitOverflowScrolling: 'touch'
|
| 267 |
+
}}
|
| 268 |
+
>
|
| 269 |
{isLoading ? (
|
| 270 |
// Skeleton Loading
|
| 271 |
<div className="space-y-2 p-2">
|
frontend/components/bookings/BookingModal.tsx
CHANGED
|
@@ -21,19 +21,19 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
|
|
| 21 |
const [selectedTime, setSelectedTime] = useState<string | null>(null)
|
| 22 |
const [bookingNote, setBookingNote] = useState('')
|
| 23 |
const [isSubmitting, setIsSubmitting] = useState(false)
|
|
|
|
| 24 |
const [services, setServices] = useState<any[]>([])
|
| 25 |
const [selectedService, setSelectedService] = useState<string | null>(null)
|
| 26 |
|
| 27 |
// Load available services (in real app)
|
| 28 |
useEffect(() => {
|
| 29 |
if (isOpen) {
|
| 30 |
-
//
|
| 31 |
bookingsApi.getServices().then(data => {
|
| 32 |
if (data && data.length > 0) {
|
| 33 |
setServices(data)
|
| 34 |
setSelectedService(data[0].id)
|
| 35 |
} else {
|
| 36 |
-
// Fallback dummy service if none exist
|
| 37 |
setServices([{ id: 'default', name: 'Консультация', duration_minutes: 30 }])
|
| 38 |
setSelectedService('default')
|
| 39 |
}
|
|
@@ -49,7 +49,6 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
|
|
| 49 |
|
| 50 |
setIsSubmitting(true)
|
| 51 |
try {
|
| 52 |
-
// Construct datetime
|
| 53 |
const [hours, minutes] = selectedTime.split(':').map(Number)
|
| 54 |
const startDateTime = new Date(selectedDate)
|
| 55 |
startDateTime.setHours(hours, minutes, 0, 0)
|
|
@@ -60,24 +59,17 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
|
|
| 60 |
|
| 61 |
await bookingsApi.createAppointment({
|
| 62 |
lead_id: leadId,
|
| 63 |
-
service_id: selectedService === 'default' ? null : selectedService,
|
| 64 |
-
// Actually backend expects valid UUID for service_id.
|
| 65 |
-
// If 'default', we might fail. Assuming user created a service or we auto-create one.
|
| 66 |
-
// For safety in this quick iteration, let's assume specific service ID or null if backend handles optional.
|
| 67 |
-
// Looking at backend model: service_id is UUID and foreign key.
|
| 68 |
-
// We MUST have a service.
|
| 69 |
-
// If demo, we might need to be careful.
|
| 70 |
start_time: startDateTime.toISOString(),
|
| 71 |
end_time: endDateTime.toISOString(),
|
| 72 |
notes: bookingNote,
|
| 73 |
status: 'scheduled'
|
| 74 |
})
|
| 75 |
|
| 76 |
-
|
| 77 |
-
alert('Встреча успешно запланирована!')
|
| 78 |
} catch (error) {
|
| 79 |
console.error('Booking error:', error)
|
| 80 |
-
|
| 81 |
} finally {
|
| 82 |
setIsSubmitting(false)
|
| 83 |
}
|
|
@@ -96,124 +88,173 @@ export function BookingModal({ isOpen, onClose, leadId, leadName }: BookingModal
|
|
| 96 |
if (!isOpen) return null
|
| 97 |
|
| 98 |
return (
|
| 99 |
-
<div className="fixed inset-0 z-50 flex items-center justify-center p-4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>
|
| 124 |
|
| 125 |
-
<
|
| 126 |
-
{
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
className="w-full p-3 bg-[#0D0E18] border border-white/10 rounded-xl font-medium focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 outline-none text-slate-200"
|
| 133 |
>
|
| 134 |
-
|
| 135 |
-
<
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
</button>
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
<button
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
className=
|
| 173 |
-
"py-2 px-1 rounded-lg text-sm font-medium transition-all text-center border",
|
| 174 |
-
selectedTime === time
|
| 175 |
-
? "bg-indigo-600 text-white border-indigo-500 shadow-sm"
|
| 176 |
-
: "bg-white/5 text-slate-400 border-transparent hover:border-white/10 hover:bg-white/10"
|
| 177 |
-
)}
|
| 178 |
>
|
| 179 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
</button>
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
<
|
| 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" />
|
| 206 |
-
) : (
|
| 207 |
-
<Check className="w-5 h-5" />
|
| 208 |
-
)}
|
| 209 |
-
{isSubmitting ? 'Создание записи...' : `Записать на ${selectedTime || '--:--'}`}
|
| 210 |
-
</button>
|
| 211 |
-
{leadName && (
|
| 212 |
-
<p className="text-center text-xs text-slate-500 mt-3 font-medium">
|
| 213 |
-
Для клиента: {leadName}
|
| 214 |
-
</p>
|
| 215 |
)}
|
| 216 |
-
</
|
| 217 |
</motion.div>
|
| 218 |
</div>
|
| 219 |
)
|
|
|
|
| 21 |
const [selectedTime, setSelectedTime] = useState<string | null>(null)
|
| 22 |
const [bookingNote, setBookingNote] = useState('')
|
| 23 |
const [isSubmitting, setIsSubmitting] = useState(false)
|
| 24 |
+
const [isSuccess, setIsSuccess] = useState(false)
|
| 25 |
const [services, setServices] = useState<any[]>([])
|
| 26 |
const [selectedService, setSelectedService] = useState<string | null>(null)
|
| 27 |
|
| 28 |
// Load available services (in real app)
|
| 29 |
useEffect(() => {
|
| 30 |
if (isOpen) {
|
| 31 |
+
setIsSuccess(false) // Reset on open
|
| 32 |
bookingsApi.getServices().then(data => {
|
| 33 |
if (data && data.length > 0) {
|
| 34 |
setServices(data)
|
| 35 |
setSelectedService(data[0].id)
|
| 36 |
} else {
|
|
|
|
| 37 |
setServices([{ id: 'default', name: 'Консультация', duration_minutes: 30 }])
|
| 38 |
setSelectedService('default')
|
| 39 |
}
|
|
|
|
| 49 |
|
| 50 |
setIsSubmitting(true)
|
| 51 |
try {
|
|
|
|
| 52 |
const [hours, minutes] = selectedTime.split(':').map(Number)
|
| 53 |
const startDateTime = new Date(selectedDate)
|
| 54 |
startDateTime.setHours(hours, minutes, 0, 0)
|
|
|
|
| 59 |
|
| 60 |
await bookingsApi.createAppointment({
|
| 61 |
lead_id: leadId,
|
| 62 |
+
service_id: selectedService === 'default' ? null : selectedService,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
start_time: startDateTime.toISOString(),
|
| 64 |
end_time: endDateTime.toISOString(),
|
| 65 |
notes: bookingNote,
|
| 66 |
status: 'scheduled'
|
| 67 |
})
|
| 68 |
|
| 69 |
+
setIsSuccess(true)
|
|
|
|
| 70 |
} catch (error) {
|
| 71 |
console.error('Booking error:', error)
|
| 72 |
+
// Use toast if available, or just log
|
| 73 |
} finally {
|
| 74 |
setIsSubmitting(false)
|
| 75 |
}
|
|
|
|
| 88 |
if (!isOpen) return null
|
| 89 |
|
| 90 |
return (
|
| 91 |
+
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
| 92 |
+
{/* Backdrop */}
|
| 93 |
+
<motion.div
|
| 94 |
+
initial={{ opacity: 0 }}
|
| 95 |
+
animate={{ opacity: 1 }}
|
| 96 |
+
exit={{ opacity: 0 }}
|
| 97 |
+
onClick={!isSubmitting ? onClose : undefined}
|
| 98 |
+
className="absolute inset-0 bg-black/80 backdrop-blur-md"
|
| 99 |
+
/>
|
| 100 |
+
|
| 101 |
<motion.div
|
| 102 |
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
| 103 |
animate={{ opacity: 1, scale: 1, y: 0 }}
|
| 104 |
exit={{ opacity: 0, scale: 0.95, y: 20 }}
|
| 105 |
+
className="relative bg-[#0D0E18]/90 backdrop-blur-2xl 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]"
|
| 106 |
+
style={{
|
| 107 |
+
willChange: 'transform',
|
| 108 |
+
transform: 'translateZ(0)'
|
| 109 |
+
}}
|
| 110 |
>
|
| 111 |
{/* Aurora Background Atmosphere */}
|
| 112 |
<div className="absolute inset-0 pointer-events-none overflow-hidden -z-10 opacity-30">
|
| 113 |
<div className="absolute top-[-10%] right-[-10%] w-[60%] h-[60%] bg-indigo-500/20 blur-[80px] rounded-full" />
|
| 114 |
<div className="absolute bottom-[-10%] left-[-10%] w-[60%] h-[60%] bg-purple-500/20 blur-[80px] rounded-full" />
|
| 115 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
+
<AnimatePresence mode="wait">
|
| 118 |
+
{isSuccess ? (
|
| 119 |
+
<motion.div
|
| 120 |
+
key="success"
|
| 121 |
+
initial={{ opacity: 0, y: 20 }}
|
| 122 |
+
animate={{ opacity: 1, y: 0 }}
|
| 123 |
+
className="p-10 flex flex-col items-center text-center"
|
|
|
|
| 124 |
>
|
| 125 |
+
<div className="w-20 h-20 rounded-3xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-center mb-6 relative">
|
| 126 |
+
<Check className="w-10 h-10 text-emerald-400" />
|
| 127 |
+
<motion.div
|
| 128 |
+
initial={{ scale: 0.8, opacity: 0 }}
|
| 129 |
+
animate={{ scale: 1.5, opacity: 0 }}
|
| 130 |
+
transition={{ duration: 1, repeat: Infinity }}
|
| 131 |
+
className="absolute inset-0 rounded-3xl border border-emerald-500/50"
|
| 132 |
+
/>
|
| 133 |
+
</div>
|
| 134 |
+
|
| 135 |
+
<h3 className="text-2xl font-bold text-white mb-2">Запись создана!</h3>
|
| 136 |
+
<p className="text-slate-400 mb-8 leading-relaxed">
|
| 137 |
+
Встреча с клиентом <span className="text-white font-medium">{leadName}</span> успешно запланирована на <span className="text-indigo-400 font-bold">{selectedTime}</span> {format(selectedDate, 'd MMMM', { locale: ru })}.
|
| 138 |
+
</p>
|
| 139 |
+
|
| 140 |
+
<button
|
| 141 |
+
onClick={onClose}
|
| 142 |
+
className="w-full py-4 bg-white/10 hover:bg-white/20 text-white font-bold rounded-2xl transition-all border border-white/10"
|
| 143 |
+
>
|
| 144 |
+
Отлично
|
| 145 |
+
</button>
|
| 146 |
+
</motion.div>
|
| 147 |
+
) : (
|
| 148 |
+
<motion.div key="form" className="flex flex-col h-full">
|
| 149 |
+
{/* Header */}
|
| 150 |
+
<div className="px-8 py-6 border-b border-white/5 flex items-center justify-between">
|
| 151 |
+
<div>
|
| 152 |
+
<h3 className="font-bold text-xl text-white flex items-center gap-2">
|
| 153 |
+
<CalendarIcon className="w-5 h-5 text-indigo-400" />
|
| 154 |
+
Записать клиента
|
| 155 |
+
</h3>
|
| 156 |
+
<p className="text-xs text-slate-400 mt-1">Выберите время для встречи</p>
|
| 157 |
+
</div>
|
| 158 |
+
<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">
|
| 159 |
+
<X className="w-5 h-5" />
|
| 160 |
</button>
|
| 161 |
+
</div>
|
| 162 |
+
|
| 163 |
+
<div className="p-6 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10" style={{ WebkitOverflowScrolling: 'touch' }}>
|
| 164 |
+
{/* Service Selection */}
|
| 165 |
+
<div className="mb-6">
|
| 166 |
+
<label className="block text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 ml-1">Тип встречи</label>
|
| 167 |
+
<select
|
| 168 |
+
value={selectedService || ''}
|
| 169 |
+
onChange={(e) => setSelectedService(e.target.value)}
|
| 170 |
+
className="w-full p-3 bg-white/5 border border-white/10 rounded-xl font-medium focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 outline-none text-slate-200"
|
| 171 |
+
>
|
| 172 |
+
{services.map(s => (
|
| 173 |
+
<option key={s.id} value={s.id} className="bg-[#0D0E18]">
|
| 174 |
+
{s.name} ({s.duration_minutes} мин)
|
| 175 |
+
</option>
|
| 176 |
+
))}
|
| 177 |
+
</select>
|
| 178 |
+
</div>
|
| 179 |
+
|
| 180 |
+
{/* Date Selection */}
|
| 181 |
+
<div className="mb-6">
|
| 182 |
+
<label className="block text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 ml-1">Выберите дату</label>
|
| 183 |
+
<div className="flex gap-2 overflow-x-auto pb-2 scrollbar-hide">
|
| 184 |
+
{dates.map((date) => (
|
| 185 |
+
<button
|
| 186 |
+
key={date.toString()}
|
| 187 |
+
onClick={() => setSelectedDate(date)}
|
| 188 |
+
className={cn(
|
| 189 |
+
"flex flex-col items-center justify-center min-w-[4.5rem] h-20 rounded-xl border transition-all",
|
| 190 |
+
isSameDay(date, selectedDate)
|
| 191 |
+
? "border-indigo-500 bg-indigo-500/20 text-indigo-300 shadow-md shadow-indigo-500/10"
|
| 192 |
+
: "border-white/5 bg-white/5 text-slate-400 hover:border-white/10 hover:bg-white/10"
|
| 193 |
+
)}
|
| 194 |
+
>
|
| 195 |
+
<span className="text-xs font-medium capitalize">{format(date, 'EEE', { locale: ru })}</span>
|
| 196 |
+
<span className="text-xl font-bold">{format(date, 'd')}</span>
|
| 197 |
+
</button>
|
| 198 |
+
))}
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
{/* Time Selection */}
|
| 203 |
+
<div className="mb-6">
|
| 204 |
+
<label className="block text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 ml-1">Выберите время</label>
|
| 205 |
+
<div className="grid grid-cols-4 gap-2">
|
| 206 |
+
{timeSlots.map(time => (
|
| 207 |
+
<button
|
| 208 |
+
key={time}
|
| 209 |
+
onClick={() => setSelectedTime(time)}
|
| 210 |
+
className={cn(
|
| 211 |
+
"py-2 px-1 rounded-lg text-sm font-medium transition-all text-center border",
|
| 212 |
+
selectedTime === time
|
| 213 |
+
? "bg-indigo-600 text-white border-indigo-500 shadow-sm"
|
| 214 |
+
: "bg-white/5 text-slate-400 border-transparent hover:border-white/10 hover:bg-white/10"
|
| 215 |
+
)}
|
| 216 |
+
>
|
| 217 |
+
{time}
|
| 218 |
+
</button>
|
| 219 |
+
))}
|
| 220 |
+
</div>
|
| 221 |
+
</div>
|
| 222 |
+
|
| 223 |
+
{/* Notes */}
|
| 224 |
+
<div>
|
| 225 |
+
<label className="block text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 ml-1">Комментарий</label>
|
| 226 |
+
<textarea
|
| 227 |
+
value={bookingNote}
|
| 228 |
+
onChange={(e) => setBookingNote(e.target.value)}
|
| 229 |
+
placeholder="О чем пойдет речь?"
|
| 230 |
+
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"
|
| 231 |
+
/>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
{/* Footer */}
|
| 236 |
+
<div className="p-8 border-t border-white/5 bg-white/[0.02]">
|
| 237 |
<button
|
| 238 |
+
onClick={handleBook}
|
| 239 |
+
disabled={!selectedDate || !selectedTime || isSubmitting}
|
| 240 |
+
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]"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
>
|
| 242 |
+
{isSubmitting ? (
|
| 243 |
+
<Loader2 className="w-5 h-5 animate-spin" />
|
| 244 |
+
) : (
|
| 245 |
+
<Check className="w-5 h-5" />
|
| 246 |
+
)}
|
| 247 |
+
{isSubmitting ? 'Создание записи...' : `Записать на ${selectedTime || '--:--'}`}
|
| 248 |
</button>
|
| 249 |
+
{leadName && (
|
| 250 |
+
<p className="text-center text-xs text-slate-500 mt-3 font-medium">
|
| 251 |
+
Для клиента: {leadName}
|
| 252 |
+
</p>
|
| 253 |
+
)}
|
| 254 |
+
</div>
|
| 255 |
+
</motion.div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
)}
|
| 257 |
+
</AnimatePresence>
|
| 258 |
</motion.div>
|
| 259 |
</div>
|
| 260 |
)
|