From f28ea8cee22e79481b716f93fe9e18a892a6cd51 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Sat, 18 Oct 2025 18:48:42 +0530
Subject: [PATCH] feat(attach): update size & icons
---
src/components/MessageInputActions/Attach.tsx | 48 ++++---------------
.../MessageInputActions/AttachSmall.tsx | 17 +++++--
2 files changed, 22 insertions(+), 43 deletions(-)
diff --git a/src/components/MessageInputActions/Attach.tsx b/src/components/MessageInputActions/Attach.tsx
index 48f14d9..fbc2e7e 100644
--- a/src/components/MessageInputActions/Attach.tsx
+++ b/src/components/MessageInputActions/Attach.tsx
@@ -17,7 +17,7 @@ import {
import { Fragment, useRef, useState } from 'react';
import { useChat } from '@/lib/hooks/useChat';
-const Attach = ({ showText }: { showText?: boolean }) => {
+const Attach = () => {
const { files, setFiles, setFileIds, fileIds } = useChat();
const [loading, setLoading] = useState(false);
@@ -52,42 +52,16 @@ const Attach = ({ showText }: { showText?: boolean }) => {
};
return loading ? (
-
-
-
- Uploading..
-
+
+
) : files.length > 0 ? (
0 ? '-ml-2 lg:-ml-3' : '',
- )}
+ className="active:border-none hover:bg-light-200 hover:dark:bg-dark-200 p-2 rounded-lg focus:outline-none headless-open:text-black dark:headless-open:text-white text-black/50 dark:text-white/50 active:scale-95 transition duration-200 hover:text-black dark:hover:text-white"
>
- {files.length > 1 && (
- <>
-
-
- {files.length} files
-
- >
- )}
-
- {files.length === 1 && (
- <>
-
-
- {files[0].fileName.length > 10
- ? files[0].fileName.replace(/\.\w+$/, '').substring(0, 3) +
- '...' +
- files[0].fileExtension
- : files[0].fileName}
-
- >
- )}
+
{
);
};
diff --git a/src/components/MessageInputActions/AttachSmall.tsx b/src/components/MessageInputActions/AttachSmall.tsx
index 20aa141..ca18f4e 100644
--- a/src/components/MessageInputActions/AttachSmall.tsx
+++ b/src/components/MessageInputActions/AttachSmall.tsx
@@ -5,7 +5,14 @@ import {
PopoverPanel,
Transition,
} from '@headlessui/react';
-import { CopyPlus, File, LoaderCircle, Paperclip, Plus, Trash } from 'lucide-react';
+import {
+ CopyPlus,
+ File,
+ LoaderCircle,
+ Paperclip,
+ Plus,
+ Trash,
+} from 'lucide-react';
import { Fragment, useRef, useState } from 'react';
import { File as FileType } from '../ChatWindow';
import { useChat } from '@/lib/hooks/useChat';
@@ -45,7 +52,7 @@ const AttachSmall = () => {
};
return loading ? (
-
+
) : files.length > 0 ? (
@@ -116,8 +123,8 @@ const AttachSmall = () => {
{file.fileName.length > 25
? file.fileName.replace(/\.\w+$/, '').substring(0, 25) +
- '...' +
- file.fileExtension
+ '...' +
+ file.fileExtension
: file.fileName}
@@ -141,7 +148,7 @@ const AttachSmall = () => {
multiple
hidden
/>
-
+
);
};