Spaces:
Running

axeronis commited on
Commit
9ad9fa2
·
1 Parent(s): 2d10f2f

fix(ui): remove sidebar borders, redesign voice cards without emojis

Browse files
frontend/app/settings/voice/page.tsx CHANGED
@@ -1,12 +1,12 @@
1
  'use client'
2
 
3
- import { useState, useEffect, useRef } from 'react'
4
  import { useAuth } from '@/contexts/AuthContext'
5
  import {
6
  Mic, MicOff, Upload, Trash2, Save, Loader2, CheckCircle2,
7
- Play, Square, Volume2, AlertCircle, Sparkles, Info
8
  } from 'lucide-react'
9
- import { motion, AnimatePresence } from 'framer-motion'
10
  import { cn } from '@/lib/utils'
11
  import { api } from '@/lib/api'
12
  import { useToast } from '@/contexts/ToastContext'
@@ -21,41 +21,38 @@ const VOICE_OPTIONS = [
21
  {
22
  id: 'professional_male',
23
  name: 'Профессионал',
24
- gender: 'Мужской',
25
- description: 'Уверенный деловой голос. Идеален для B2B продаж.',
26
- icon: '👔',
27
- color: 'indigo',
 
28
  demoText: 'Здравствуйте! Я ваш менеджер. Готов помочь найти решение для бизнеса.',
29
- traits: ['Уверенный', 'Деловой']
30
  },
31
  {
32
  id: 'friendly_male',
33
  name: 'Дружелюбный',
34
- gender: 'Мужской',
35
- description: 'Тёплый голос для налаживания контакта.',
36
- icon: '😊',
37
- color: 'emerald',
 
38
  demoText: 'Привет! Рад что написали. Давайте разберёмся что вам нужно!',
39
- traits: ['Тёплый', 'Располагающий']
40
  },
41
  {
42
  id: 'professional_female',
43
  name: 'Элегантный',
44
- gender: 'Женский',
45
- description: 'Профессиональный женский голос.',
46
- icon: '👩‍💼',
47
- color: 'purple',
 
48
  demoText: 'Добрый день! Спасибо за интерес. Расскажу подробнее.',
49
- traits: ['Элегантный', 'Приятный']
50
  }
51
  ]
52
 
53
- const COLOR_MAP: Record<string, { bg: string, text: string, badge: string }> = {
54
- indigo: { bg: 'bg-indigo-500/10', text: 'text-indigo-400', badge: 'bg-indigo-500/20 text-indigo-300' },
55
- emerald: { bg: 'bg-emerald-500/10', text: 'text-emerald-400', badge: 'bg-emerald-500/20 text-emerald-300' },
56
- purple: { bg: 'bg-purple-500/10', text: 'text-purple-400', badge: 'bg-purple-500/20 text-purple-300' }
57
- }
58
-
59
  export default function VoiceSettingsPage() {
60
  const { token } = useAuth()
61
  const toast = useToast()
@@ -66,7 +63,6 @@ export default function VoiceSettingsPage() {
66
  })
67
  const [loading, setLoading] = useState(true)
68
  const [saving, setSaving] = useState(false)
69
- const [uploading, setUploading] = useState(false)
70
  const [playingVoice, setPlayingVoice] = useState<string | null>(null)
71
  const [isServiceAvailable] = useState<boolean>(false)
72
 
@@ -90,14 +86,10 @@ export default function VoiceSettingsPage() {
90
  if (token) fetchSettings()
91
  }, [token])
92
 
93
- const stopPlayback = () => {
94
- window.speechSynthesis.cancel()
95
- setPlayingVoice(null)
96
- }
97
-
98
  const playDemoVoice = (voiceId: string, text: string) => {
99
  if (playingVoice) {
100
- stopPlayback()
 
101
  if (playingVoice === voiceId) return
102
  }
103
 
@@ -149,22 +141,22 @@ export default function VoiceSettingsPage() {
149
  }
150
 
151
  return (
152
- <div className="max-w-4xl mx-auto p-6 space-y-6">
153
  {/* Header */}
154
  <div className="flex items-center justify-between">
155
- <div>
156
- <h1 className="text-2xl font-bold text-white flex items-center gap-3">
157
- <div className="p-2 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600">
158
- <Volume2 className="w-6 h-6 text-white" />
159
- </div>
160
- Голос AI
161
- </h1>
162
- <p className="text-zinc-400 mt-1">Настройте голос AI-менеджера</p>
163
  </div>
164
  <button
165
  onClick={saveSettings}
166
  disabled={saving}
167
- className="flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 rounded-xl text-white font-medium transition-all disabled:opacity-50"
168
  >
169
  {saving ? <Loader2 className="w-4 h-4 animate-spin" /> : <Save className="w-4 h-4" />}
170
  Сохранить
@@ -173,139 +165,192 @@ export default function VoiceSettingsPage() {
173
 
174
  {/* Service Status */}
175
  {!isServiceAvailable && (
176
- <div className="bg-amber-500/10 rounded-xl p-4 flex items-start gap-3">
 
 
 
 
177
  <AlertCircle className="w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5" />
178
  <div>
179
- <p className="text-amber-200 font-medium">Голосовой сервис не подключен</p>
180
- <p className="text-amber-300/70 text-sm mt-1">
181
- Демо использует браузерный синтез (роботизированный). После развертывания Chatterbox голоса будут естественными.
182
  </p>
183
  </div>
184
- </div>
185
  )}
186
 
187
  {/* Voice Toggle */}
188
- <div className="bg-zinc-900/50 rounded-xl p-5">
 
 
 
 
189
  <div className="flex items-center justify-between">
190
  <div className="flex items-center gap-4">
191
  <div className={cn(
192
- "w-12 h-12 rounded-xl flex items-center justify-center",
193
  settings.voice_enabled
194
- ? "bg-gradient-to-br from-indigo-500 to-purple-600"
195
  : "bg-zinc-800"
196
  )}>
197
- {settings.voice_enabled ? <Mic className="w-6 h-6 text-white" /> : <MicOff className="w-6 h-6 text-zinc-500" />}
 
 
 
 
198
  </div>
199
  <div>
200
- <h3 className="text-lg font-medium text-white">Голосовые ответы</h3>
201
  <p className="text-zinc-500 text-sm">
202
- {settings.voice_enabled ? 'AI отправляет голосовые в ключевые моменты' : 'Только текст'}
 
 
 
203
  </p>
204
  </div>
205
  </div>
206
  <button
207
  onClick={() => setSettings(prev => ({ ...prev, voice_enabled: !prev.voice_enabled }))}
208
  className={cn(
209
- "relative w-14 h-8 rounded-full transition-all",
210
- settings.voice_enabled ? "bg-gradient-to-r from-indigo-600 to-purple-600" : "bg-zinc-700"
 
 
211
  )}
212
  >
213
  <motion.div
214
- animate={{ x: settings.voice_enabled ? 26 : 4 }}
215
  transition={{ type: "spring", stiffness: 500, damping: 30 }}
216
- className="absolute top-1 w-6 h-6 bg-white rounded-full shadow-lg"
217
  />
218
  </button>
219
  </div>
220
- </div>
221
 
222
  {/* Voice Selection */}
223
  <div className="space-y-4">
224
  <div className="flex items-center justify-between">
225
- <div className="flex items-center gap-2">
226
- <Sparkles className="w-5 h-5 text-indigo-400" />
227
- <h3 className="text-lg font-medium text-white">Выберите голос</h3>
228
- </div>
229
- <span className="text-zinc-500 text-sm">▶ — прослушать демо</span>
230
  </div>
231
 
232
  <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
233
- {VOICE_OPTIONS.map((voice) => {
234
  const isSelected = settings.voice_id === voice.id
235
  const isPlaying = playingVoice === voice.id
236
- const colors = COLOR_MAP[voice.color]
237
 
238
  return (
239
- <div
240
  key={voice.id}
 
 
 
241
  onClick={() => setSettings(prev => ({ ...prev, voice_id: voice.id }))}
242
  className={cn(
243
- "relative p-4 rounded-xl cursor-pointer transition-all",
244
- isSelected ? colors.bg : "bg-zinc-900/50 hover:bg-zinc-800/50"
 
 
245
  )}
246
  >
 
247
  {isSelected && (
248
- <div className="absolute -top-1.5 -right-1.5 w-5 h-5 bg-white rounded-full flex items-center justify-center">
249
- <CheckCircle2 className={cn("w-4 h-4", colors.text)} />
 
 
250
  </div>
251
  )}
252
 
253
- <div className="flex items-center gap-3 mb-2">
254
- <span className="text-2xl">{voice.icon}</span>
255
- <div>
256
- <h4 className="font-medium text-white">{voice.name}</h4>
257
- <span className="text-xs text-zinc-500">{voice.gender}</span>
258
- </div>
 
 
259
  </div>
260
 
261
- <p className="text-sm text-zinc-400 mb-3">{voice.description}</p>
 
 
 
262
 
263
- <div className="flex flex-wrap gap-1 mb-3">
 
264
  {voice.traits.map(trait => (
265
- <span key={trait} className={cn("px-2 py-0.5 rounded-full text-xs", isSelected ? colors.badge : "bg-zinc-800 text-zinc-500")}>
 
 
 
 
 
 
 
 
266
  {trait}
267
  </span>
268
  ))}
269
  </div>
270
 
 
271
  <button
272
  onClick={(e) => {
273
  e.stopPropagation()
274
  playDemoVoice(voice.id, voice.demoText)
275
  }}
276
  className={cn(
277
- "w-full flex items-center justify-center gap-2 py-2 rounded-lg transition-all text-sm",
278
- isPlaying ? `${colors.bg} ${colors.text}` : "bg-zinc-800 hover:bg-zinc-700 text-zinc-400"
 
 
 
 
279
  )}
280
  >
281
  {isPlaying ? (
282
- <><Square className="w-3.5 h-3.5" /> Стоп</>
283
  ) : (
284
- <><Play className="w-3.5 h-3.5" /> Демо</>
285
  )}
286
  </button>
287
- </div>
288
  )
289
  })}
290
  </div>
291
  </div>
292
 
293
- {/* Custom Voice */}
294
- <div className="bg-zinc-900/50 rounded-xl p-5">
295
- <div className="flex items-center gap-2 mb-2">
296
- <Upload className="w-5 h-5 text-purple-400" />
297
- <h3 className="font-medium text-white">Клонировать свой голос</h3>
298
- <span className="px-2 py-0.5 rounded-full bg-purple-500/20 text-purple-300 text-xs">Скоро</span>
 
 
 
 
 
 
 
 
 
 
 
 
299
  </div>
300
- <p className="text-zinc-500 text-sm mb-4">Загрузите аудио 10-30 сек для клонирования</p>
301
 
302
  {settings.voice_reference_url ? (
303
- <div className="flex items-center gap-4 p-3 bg-zinc-800/50 rounded-lg">
304
- <CheckCircle2 className="w-5 h-5 text-green-400" />
305
- <div className="flex-1">
306
- <p className="text-white text-sm">Голос загружен</p>
307
- </div>
308
- <button onClick={() => setSettings(prev => ({ ...prev, voice_reference_url: null, voice_id: 'professional_male' }))} className="p-1.5 text-red-400 hover:bg-red-500/10 rounded-lg">
 
309
  <Trash2 className="w-4 h-4" />
310
  </button>
311
  </div>
@@ -313,36 +358,43 @@ export default function VoiceSettingsPage() {
313
  <label className="block">
314
  <input type="file" accept="audio/*" onChange={handleFileUpload} className="hidden" disabled={!isServiceAvailable} />
315
  <div className={cn(
316
- "flex flex-col items-center justify-center p-6 rounded-xl transition-colors",
317
- !isServiceAvailable ? "bg-zinc-800/30 cursor-not-allowed opacity-50" : "bg-zinc-800/50 hover:bg-zinc-800 cursor-pointer"
 
 
318
  )}>
319
- <Upload className="w-6 h-6 text-zinc-500 mb-2" />
320
- <p className="text-zinc-400 text-sm">{!isServiceAvailable ? 'Подключите сервис' : 'Загрузить аудио'}</p>
 
 
 
321
  </div>
322
  </label>
323
  )}
324
- </div>
325
 
326
  {/* Info */}
327
- <div className="bg-gradient-to-br from-indigo-500/5 to-purple-500/5 rounded-xl p-5">
328
- <h3 className="font-medium text-white mb-3 flex items-center gap-2">
329
- <Info className="w-4 h-4 text-indigo-400" />
330
- Когда AI отправляет голосовые?
331
- </h3>
332
- <div className="grid grid-cols-2 gap-2 text-sm">
 
 
333
  {[
334
- { emoji: '🎙️', text: 'Ответ на голосовое клиента' },
335
- { emoji: '🤝', text: 'Закрытие сделки' },
336
- { emoji: '💪', text: 'Преодоление возражений' },
337
- { emoji: '❤️', text: 'Создание доверия' }
338
  ].map((item, i) => (
339
- <div key={i} className="flex items-center gap-2 p-2 rounded-lg bg-zinc-900/30">
340
- <span>{item.emoji}</span>
341
- <span className="text-zinc-400">{item.text}</span>
342
  </div>
343
  ))}
344
  </div>
345
- </div>
346
  </div>
347
  )
348
  }
 
1
  'use client'
2
 
3
+ import { useState, useEffect } from 'react'
4
  import { useAuth } from '@/contexts/AuthContext'
5
  import {
6
  Mic, MicOff, Upload, Trash2, Save, Loader2, CheckCircle2,
7
+ Play, Square, Volume2, AlertCircle, User, UserCircle, Briefcase
8
  } from 'lucide-react'
9
+ import { motion } from 'framer-motion'
10
  import { cn } from '@/lib/utils'
11
  import { api } from '@/lib/api'
12
  import { useToast } from '@/contexts/ToastContext'
 
21
  {
22
  id: 'professional_male',
23
  name: 'Профессионал',
24
+ gender: 'Мужской голос',
25
+ description: 'Уверенный деловой тон. Идеален для B2B продаж и консалтинга.',
26
+ icon: Briefcase,
27
+ gradient: 'from-indigo-500 to-blue-600',
28
+ bgGradient: 'from-indigo-500/20 to-blue-600/10',
29
  demoText: 'Здравствуйте! Я ваш менеджер. Готов помочь найти решение для бизнеса.',
30
+ traits: ['Уверенный', 'Деловой', 'Авторитетный']
31
  },
32
  {
33
  id: 'friendly_male',
34
  name: 'Дружелюбный',
35
+ gender: 'Мужской голос',
36
+ description: 'Тёплый голос для налаживания контакта. Отлично работает в B2C.',
37
+ icon: User,
38
+ gradient: 'from-emerald-500 to-teal-600',
39
+ bgGradient: 'from-emerald-500/20 to-teal-600/10',
40
  demoText: 'Привет! Рад что написали. Давайте разберёмся что вам нужно!',
41
+ traits: ['Тёплый', 'Располагающий', 'Дружелюбный']
42
  },
43
  {
44
  id: 'professional_female',
45
  name: 'Элегантный',
46
+ gender: 'Женский голос',
47
+ description: 'Профессиональный женский голос. Вызывает доверие и симпатию.',
48
+ icon: UserCircle,
49
+ gradient: 'from-purple-500 to-pink-600',
50
+ bgGradient: 'from-purple-500/20 to-pink-600/10',
51
  demoText: 'Добрый день! Спасибо за интерес. Расскажу подробнее.',
52
+ traits: ['Элегантный', 'Приятный', 'Доверительный']
53
  }
54
  ]
55
 
 
 
 
 
 
 
56
  export default function VoiceSettingsPage() {
57
  const { token } = useAuth()
58
  const toast = useToast()
 
63
  })
64
  const [loading, setLoading] = useState(true)
65
  const [saving, setSaving] = useState(false)
 
66
  const [playingVoice, setPlayingVoice] = useState<string | null>(null)
67
  const [isServiceAvailable] = useState<boolean>(false)
68
 
 
86
  if (token) fetchSettings()
87
  }, [token])
88
 
 
 
 
 
 
89
  const playDemoVoice = (voiceId: string, text: string) => {
90
  if (playingVoice) {
91
+ window.speechSynthesis.cancel()
92
+ setPlayingVoice(null)
93
  if (playingVoice === voiceId) return
94
  }
95
 
 
141
  }
142
 
143
  return (
144
+ <div className="max-w-4xl mx-auto p-6 space-y-8">
145
  {/* Header */}
146
  <div className="flex items-center justify-between">
147
+ <div className="flex items-center gap-4">
148
+ <div className="w-12 h-12 rounded-2xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/25">
149
+ <Volume2 className="w-6 h-6 text-white" />
150
+ </div>
151
+ <div>
152
+ <h1 className="text-2xl font-bold text-white">Голос AI</h1>
153
+ <p className="text-zinc-500 text-sm">Настройте голос AI-менеджера</p>
154
+ </div>
155
  </div>
156
  <button
157
  onClick={saveSettings}
158
  disabled={saving}
159
+ className="flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-indigo-500 to-purple-600 hover:from-indigo-400 hover:to-purple-500 rounded-xl text-white font-semibold transition-all shadow-lg shadow-indigo-500/25 disabled:opacity-50"
160
  >
161
  {saving ? <Loader2 className="w-4 h-4 animate-spin" /> : <Save className="w-4 h-4" />}
162
  Сохранить
 
165
 
166
  {/* Service Status */}
167
  {!isServiceAvailable && (
168
+ <motion.div
169
+ initial={{ opacity: 0, y: -10 }}
170
+ animate={{ opacity: 1, y: 0 }}
171
+ className="p-4 rounded-xl bg-gradient-to-r from-amber-500/10 to-orange-500/5 flex items-start gap-3"
172
+ >
173
  <AlertCircle className="w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5" />
174
  <div>
175
+ <p className="text-amber-200 font-medium text-sm">Голосовой сервис не подключен</p>
176
+ <p className="text-amber-300/60 text-xs mt-1">
177
+ Демо использует браузерный синтез. После развертывания Chatterbox голоса будут естественными.
178
  </p>
179
  </div>
180
+ </motion.div>
181
  )}
182
 
183
  {/* Voice Toggle */}
184
+ <motion.div
185
+ initial={{ opacity: 0, y: 20 }}
186
+ animate={{ opacity: 1, y: 0 }}
187
+ className="p-6 rounded-2xl bg-gradient-to-br from-zinc-900/80 to-zinc-900/40"
188
+ >
189
  <div className="flex items-center justify-between">
190
  <div className="flex items-center gap-4">
191
  <div className={cn(
192
+ "w-14 h-14 rounded-2xl flex items-center justify-center transition-all duration-300",
193
  settings.voice_enabled
194
+ ? "bg-gradient-to-br from-indigo-500 to-purple-600 shadow-lg shadow-indigo-500/30"
195
  : "bg-zinc-800"
196
  )}>
197
+ {settings.voice_enabled ? (
198
+ <Mic className="w-7 h-7 text-white" />
199
+ ) : (
200
+ <MicOff className="w-7 h-7 text-zinc-500" />
201
+ )}
202
  </div>
203
  <div>
204
+ <h3 className="text-lg font-semibold text-white">Голосовые ответы</h3>
205
  <p className="text-zinc-500 text-sm">
206
+ {settings.voice_enabled
207
+ ? 'AI отправляет голосовые в ключевые моменты'
208
+ : 'AI отвечает только текстом'
209
+ }
210
  </p>
211
  </div>
212
  </div>
213
  <button
214
  onClick={() => setSettings(prev => ({ ...prev, voice_enabled: !prev.voice_enabled }))}
215
  className={cn(
216
+ "relative w-16 h-9 rounded-full transition-all duration-300",
217
+ settings.voice_enabled
218
+ ? "bg-gradient-to-r from-indigo-500 to-purple-600"
219
+ : "bg-zinc-700"
220
  )}
221
  >
222
  <motion.div
223
+ animate={{ x: settings.voice_enabled ? 30 : 4 }}
224
  transition={{ type: "spring", stiffness: 500, damping: 30 }}
225
+ className="absolute top-1.5 w-6 h-6 bg-white rounded-full shadow-lg"
226
  />
227
  </button>
228
  </div>
229
+ </motion.div>
230
 
231
  {/* Voice Selection */}
232
  <div className="space-y-4">
233
  <div className="flex items-center justify-between">
234
+ <h3 className="text-lg font-semibold text-white">Выберите голос</h3>
235
+ <span className="text-zinc-600 text-sm">Нажмите карточку для выбора</span>
 
 
 
236
  </div>
237
 
238
  <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
239
+ {VOICE_OPTIONS.map((voice, index) => {
240
  const isSelected = settings.voice_id === voice.id
241
  const isPlaying = playingVoice === voice.id
242
+ const IconComponent = voice.icon
243
 
244
  return (
245
+ <motion.div
246
  key={voice.id}
247
+ initial={{ opacity: 0, y: 20 }}
248
+ animate={{ opacity: 1, y: 0 }}
249
+ transition={{ delay: index * 0.1 }}
250
  onClick={() => setSettings(prev => ({ ...prev, voice_id: voice.id }))}
251
  className={cn(
252
+ "relative p-5 rounded-2xl cursor-pointer transition-all duration-300 group overflow-hidden",
253
+ isSelected
254
+ ? `bg-gradient-to-br ${voice.bgGradient}`
255
+ : "bg-zinc-900/50 hover:bg-zinc-800/50"
256
  )}
257
  >
258
+ {/* Selected indicator */}
259
  {isSelected && (
260
+ <div className="absolute top-3 right-3">
261
+ <div className={cn("w-6 h-6 rounded-full bg-gradient-to-r flex items-center justify-center", voice.gradient)}>
262
+ <CheckCircle2 className="w-4 h-4 text-white" />
263
+ </div>
264
  </div>
265
  )}
266
 
267
+ {/* Icon */}
268
+ <div className={cn(
269
+ "w-12 h-12 rounded-xl flex items-center justify-center mb-4 transition-all",
270
+ isSelected
271
+ ? `bg-gradient-to-br ${voice.gradient} shadow-lg`
272
+ : "bg-zinc-800 group-hover:bg-zinc-700"
273
+ )}>
274
+ <IconComponent className={cn("w-6 h-6", isSelected ? "text-white" : "text-zinc-400")} />
275
  </div>
276
 
277
+ {/* Content */}
278
+ <h4 className="font-semibold text-white mb-1">{voice.name}</h4>
279
+ <p className="text-zinc-500 text-xs mb-2">{voice.gender}</p>
280
+ <p className="text-zinc-400 text-sm mb-4 leading-relaxed">{voice.description}</p>
281
 
282
+ {/* Traits */}
283
+ <div className="flex flex-wrap gap-1.5 mb-4">
284
  {voice.traits.map(trait => (
285
+ <span
286
+ key={trait}
287
+ className={cn(
288
+ "px-2 py-0.5 rounded-full text-xs transition-colors",
289
+ isSelected
290
+ ? "bg-white/10 text-white/80"
291
+ : "bg-zinc-800 text-zinc-500"
292
+ )}
293
+ >
294
  {trait}
295
  </span>
296
  ))}
297
  </div>
298
 
299
+ {/* Play button */}
300
  <button
301
  onClick={(e) => {
302
  e.stopPropagation()
303
  playDemoVoice(voice.id, voice.demoText)
304
  }}
305
  className={cn(
306
+ "w-full flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all text-sm font-medium",
307
+ isPlaying
308
+ ? `bg-gradient-to-r ${voice.gradient} text-white shadow-lg`
309
+ : isSelected
310
+ ? "bg-white/10 text-white hover:bg-white/20"
311
+ : "bg-zinc-800 text-zinc-400 hover:bg-zinc-700 hover:text-white"
312
  )}
313
  >
314
  {isPlaying ? (
315
+ <><Square className="w-4 h-4" /> Остановить</>
316
  ) : (
317
+ <><Play className="w-4 h-4" /> Прослушать демо</>
318
  )}
319
  </button>
320
+ </motion.div>
321
  )
322
  })}
323
  </div>
324
  </div>
325
 
326
+ {/* Custom Voice Upload */}
327
+ <motion.div
328
+ initial={{ opacity: 0, y: 20 }}
329
+ animate={{ opacity: 1, y: 0 }}
330
+ transition={{ delay: 0.3 }}
331
+ className="p-6 rounded-2xl bg-gradient-to-br from-zinc-900/80 to-zinc-900/40"
332
+ >
333
+ <div className="flex items-center gap-3 mb-4">
334
+ <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-purple-500 to-pink-600 flex items-center justify-center">
335
+ <Upload className="w-5 h-5 text-white" />
336
+ </div>
337
+ <div>
338
+ <div className="flex items-center gap-2">
339
+ <h3 className="font-semibold text-white">Клонировать свой голос</h3>
340
+ <span className="px-2 py-0.5 rounded-full bg-purple-500/20 text-purple-300 text-xs font-medium">Скоро</span>
341
+ </div>
342
+ <p className="text-zinc-500 text-sm">Загрузите аудио 10-30 сек для клонирования</p>
343
+ </div>
344
  </div>
 
345
 
346
  {settings.voice_reference_url ? (
347
+ <div className="flex items-center gap-4 p-4 rounded-xl bg-emerald-500/10">
348
+ <CheckCircle2 className="w-5 h-5 text-emerald-400" />
349
+ <span className="text-white text-sm flex-1">Голос загружен</span>
350
+ <button
351
+ onClick={() => setSettings(prev => ({ ...prev, voice_reference_url: null, voice_id: 'professional_male' }))}
352
+ className="p-2 text-red-400 hover:bg-red-500/10 rounded-lg transition-colors"
353
+ >
354
  <Trash2 className="w-4 h-4" />
355
  </button>
356
  </div>
 
358
  <label className="block">
359
  <input type="file" accept="audio/*" onChange={handleFileUpload} className="hidden" disabled={!isServiceAvailable} />
360
  <div className={cn(
361
+ "flex flex-col items-center justify-center p-8 rounded-xl transition-all",
362
+ !isServiceAvailable
363
+ ? "bg-zinc-800/30 cursor-not-allowed opacity-50"
364
+ : "bg-zinc-800/50 hover:bg-zinc-800 cursor-pointer"
365
  )}>
366
+ <Upload className="w-8 h-8 text-zinc-600 mb-2" />
367
+ <p className="text-zinc-400 text-sm">
368
+ {!isServiceAvailable ? 'Сначала подключите голосовой сервис' : 'Нажмите для загрузки аудио'}
369
+ </p>
370
+ <p className="text-zinc-600 text-xs mt-1">WAV, MP3, OGG • Максимум 10MB</p>
371
  </div>
372
  </label>
373
  )}
374
+ </motion.div>
375
 
376
  {/* Info */}
377
+ <motion.div
378
+ initial={{ opacity: 0, y: 20 }}
379
+ animate={{ opacity: 1, y: 0 }}
380
+ transition={{ delay: 0.4 }}
381
+ className="p-6 rounded-2xl bg-gradient-to-br from-indigo-500/5 via-purple-500/5 to-pink-500/5"
382
+ >
383
+ <h3 className="font-semibold text-white mb-4">Когда AI отправляет голосовые?</h3>
384
+ <div className="grid grid-cols-2 gap-3">
385
  {[
386
+ { icon: Mic, label: 'Ответ на голосовое клиента' },
387
+ { icon: CheckCircle2, label: 'Закрытие сделки' },
388
+ { icon: AlertCircle, label: 'Преодоление возражений' },
389
+ { icon: User, label: 'Создание доверия' }
390
  ].map((item, i) => (
391
+ <div key={i} className="flex items-center gap-3 p-3 rounded-xl bg-white/5">
392
+ <item.icon className="w-4 h-4 text-indigo-400" />
393
+ <span className="text-zinc-400 text-sm">{item.label}</span>
394
  </div>
395
  ))}
396
  </div>
397
+ </motion.div>
398
  </div>
399
  )
400
  }
frontend/components/Sidebar.tsx CHANGED
@@ -143,10 +143,10 @@ export function Sidebar() {
143
  initial="hidden"
144
  animate="visible"
145
  variants={sidebarVariants}
146
- className="w-72 bg-md-surface-container-low border-r border-md-outline-variant flex flex-col relative shrink-0 h-screen sticky top-0"
147
  >
148
  {/* Logo Section */}
149
- <div className="p-6 border-b border-md-outline-variant relative z-50">
150
  <Link href="/dashboard" className="flex items-center gap-3 group">
151
  <div className="w-12 h-12 flex items-center justify-center">
152
  <img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain" />
 
143
  initial="hidden"
144
  animate="visible"
145
  variants={sidebarVariants}
146
+ className="w-72 bg-md-surface-container-low flex flex-col relative shrink-0 h-screen sticky top-0"
147
  >
148
  {/* Logo Section */}
149
+ <div className="p-6 relative z-50">
150
  <Link href="/dashboard" className="flex items-center gap-3 group">
151
  <div className="w-12 h-12 flex items-center justify-center">
152
  <img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain" />