From 24c32ed88194af49905b8c5484d1edb3f85398b7 Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Tue, 23 Dec 2025 18:53:40 +0530 Subject: [PATCH] feat(app): enhance attach transition --- src/components/MessageInputActions/Attach.tsx | 161 ++++++++-------- .../MessageInputActions/AttachSmall.tsx | 172 +++++++++--------- 2 files changed, 173 insertions(+), 160 deletions(-) diff --git a/src/components/MessageInputActions/Attach.tsx b/src/components/MessageInputActions/Attach.tsx index fbc2e7e..84d7152 100644 --- a/src/components/MessageInputActions/Attach.tsx +++ b/src/components/MessageInputActions/Attach.tsx @@ -16,6 +16,8 @@ import { } from 'lucide-react'; import { Fragment, useRef, useState } from 'react'; import { useChat } from '@/lib/hooks/useChat'; +import { AnimatePresence } from 'motion/react'; +import { motion } from 'framer-motion'; const Attach = () => { const { files, setFiles, setFileIds, fileIds } = useChat(); @@ -53,86 +55,95 @@ const Attach = () => { return loading ? (
- +
) : files.length > 0 ? ( - - - - - -
-
-

- Attached files -

-
- - -
-
-
-
- {files.map((file, i) => ( -
-
- +
+

+ Attached files +

+
+ + +
-

- {file.fileName.length > 25 - ? file.fileName.replace(/\.\w+$/, '').substring(0, 25) + - '...' + - file.fileExtension - : file.fileName} -

-
- ))} -
-
- - +
+
+ {files.map((file, i) => ( +
+
+ +
+

+ {file.fileName.length > 25 + ? file.fileName + .replace(/\.\w+$/, '') + .substring(0, 25) + + '...' + + file.fileExtension + : file.fileName} +

+
+ ))} +
+ + + )} + + + )} ) : ( - -
-
-
-
- {files.map((file, i) => ( -
-
- +
+

+ Attached files +

+
+ + +
-

- {file.fileName.length > 25 - ? file.fileName.replace(/\.\w+$/, '').substring(0, 25) + - '...' + - file.fileExtension - : file.fileName} -

-
- ))} -
-
- - +
+
+ {files.map((file, i) => ( +
+
+ +
+

+ {file.fileName.length > 25 + ? file.fileName + .replace(/\.\w+$/, '') + .substring(0, 25) + + '...' + + file.fileExtension + : file.fileName} +

+
+ ))} +
+ + + )} + + + )} ) : (