Spaces:
Sleeping
Sleeping
axeronis commited on
Commit ·
735c3a0
1
Parent(s): 8e132dd
fix(ux): finalize global image viewer and polish toggle shape
Browse files
frontend/components/ChatWindow.tsx
CHANGED
|
@@ -489,6 +489,13 @@ export function ChatWindow({
|
|
| 489 |
)}
|
| 490 |
</AnimatePresence>
|
| 491 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 492 |
{/* Train AI Confirmation Modal */}
|
| 493 |
<ConfirmModal
|
| 494 |
isOpen={isTrainConfirmOpen}
|
|
|
|
| 489 |
)}
|
| 490 |
</AnimatePresence>
|
| 491 |
|
| 492 |
+
<ImageViewer
|
| 493 |
+
src={viewerData.src}
|
| 494 |
+
alt={viewerData.alt}
|
| 495 |
+
isOpen={viewerData.isOpen}
|
| 496 |
+
onClose={() => setViewerData(prev => ({ ...prev, isOpen: false }))}
|
| 497 |
+
/>
|
| 498 |
+
|
| 499 |
{/* Train AI Confirmation Modal */}
|
| 500 |
<ConfirmModal
|
| 501 |
isOpen={isTrainConfirmOpen}
|
frontend/components/ChatWindow/ChatHeader.tsx
CHANGED
|
@@ -118,21 +118,21 @@ export function ChatHeader({
|
|
| 118 |
isTogglingAI && "opacity-80"
|
| 119 |
)}
|
| 120 |
style={{
|
| 121 |
-
width: '
|
| 122 |
-
minWidth: '
|
| 123 |
-
height: '
|
| 124 |
-
borderRadius: '
|
| 125 |
}}
|
| 126 |
title={isAIActive ? 'AI Активен' : 'AI Отключен'}
|
| 127 |
>
|
| 128 |
{/* Thumb */}
|
| 129 |
<motion.div
|
| 130 |
animate={{
|
| 131 |
-
x: isAIActive ?
|
| 132 |
scale: isTogglingAI ? 0.85 : 1,
|
| 133 |
}}
|
| 134 |
transition={{ type: "spring", stiffness: 500, damping: 30 }}
|
| 135 |
-
className="absolute top-[
|
| 136 |
>
|
| 137 |
{isTogglingAI && (
|
| 138 |
<Loader2 className="w-3 h-3 animate-spin text-indigo-500" />
|
|
|
|
| 118 |
isTogglingAI && "opacity-80"
|
| 119 |
)}
|
| 120 |
style={{
|
| 121 |
+
width: '48px',
|
| 122 |
+
minWidth: '48px',
|
| 123 |
+
height: '24px',
|
| 124 |
+
borderRadius: '24px',
|
| 125 |
}}
|
| 126 |
title={isAIActive ? 'AI Активен' : 'AI Отключен'}
|
| 127 |
>
|
| 128 |
{/* Thumb */}
|
| 129 |
<motion.div
|
| 130 |
animate={{
|
| 131 |
+
x: isAIActive ? 26 : 2,
|
| 132 |
scale: isTogglingAI ? 0.85 : 1,
|
| 133 |
}}
|
| 134 |
transition={{ type: "spring", stiffness: 500, damping: 30 }}
|
| 135 |
+
className="absolute top-[2px] w-[18px] h-[18px] rounded-full bg-white shadow-md flex items-center justify-center z-10"
|
| 136 |
>
|
| 137 |
{isTogglingAI && (
|
| 138 |
<Loader2 className="w-3 h-3 animate-spin text-indigo-500" />
|