{/* `flex`, so the button inside is not laid out on a text baseline: the
diff --git a/client/src/components/Chat/Input/Files/ImagePreview.tsx b/packages/chat/src/components/composer/files/ImagePreview.tsx
similarity index 98%
rename from client/src/components/Chat/Input/Files/ImagePreview.tsx
rename to packages/chat/src/components/composer/files/ImagePreview.tsx
index 05088d9cf9..3ba6e175a8 100644
--- a/client/src/components/Chat/Input/Files/ImagePreview.tsx
+++ b/packages/chat/src/components/composer/files/ImagePreview.tsx
@@ -1,12 +1,10 @@
import { useState, useEffect, useCallback, useRef } from 'react';
-import { Button } from '@librechat/client';
import { Maximize2, X } from 'lucide-react';
import { FileSources } from 'librechat-data-provider';
import * as DialogPrimitive from '@radix-ui/react-dialog';
+import { cn, Button, useLocalize } from '@librechat/client';
import ProgressCircle from './ProgressCircle';
import SourceIcon from './SourceIcon';
-import { useLocalize } from '~/hooks';
-import { cn } from '~/utils';
type styleProps = {
backgroundImage?: string;
@@ -29,7 +27,7 @@ const ImagePreview = ({
className?: string;
source?: FileSources;
alt?: string;
-}) => {
+}): React.JSX.Element | null => {
const localize = useLocalize();
const [isModalOpen, setIsModalOpen] = useState(false);
const [isHovered, setIsHovered] = useState(false);
diff --git a/client/src/components/Chat/Input/Files/PastedTextDialog.tsx b/packages/chat/src/components/composer/files/PastedTextDialog.tsx
similarity index 80%
rename from client/src/components/Chat/Input/Files/PastedTextDialog.tsx
rename to packages/chat/src/components/composer/files/PastedTextDialog.tsx
index 6d6c88bd58..5fbc04aa73 100644
--- a/client/src/components/Chat/Input/Files/PastedTextDialog.tsx
+++ b/packages/chat/src/components/composer/files/PastedTextDialog.tsx
@@ -2,14 +2,24 @@ import { useId, useState } from 'react';
import {
Button,
OGDialog,
+ useLocalize,
Textarea,
OGDialogClose,
OGDialogTitle,
OGDialogHeader,
OGDialogContent,
} from '@librechat/client';
-import type { PastedTextEdit } from '~/hooks/Files/usePastedTextEdit';
-import { useLocalize } from '~/hooks';
+import type { ExtendedFile } from '../../../core/files';
+
+/** The attachment being edited, with its text already resolved so the dialog stays controlled. */
+export type PastedTextEdit = {
+ file: ExtendedFile;
+ text: string;
+ /** The composer the dialog was opened in; an edit must never apply to a different one. */
+ conversationId: string | null;
+ /** Distinguishes two successive unsaved chats, which share the `new` conversation id. */
+ draftToken: symbol;
+};
/**
* Opens the text behind a `pasted-text.txt` chip so it can be corrected before sending. Returning
@@ -24,7 +34,7 @@ export default function PastedTextDialog({
edit: PastedTextEdit | null;
onClose: () => void;
onSave: (text: string) => void;
-}) {
+}): React.JSX.Element {
const localize = useLocalize();
const fieldId = useId();
const [text, setText] = useState('');
diff --git a/client/src/components/Chat/Input/Files/ProgressCircle.tsx b/packages/chat/src/components/composer/files/ProgressCircle.tsx
similarity index 97%
rename from client/src/components/Chat/Input/Files/ProgressCircle.tsx
rename to packages/chat/src/components/composer/files/ProgressCircle.tsx
index ac7e70e0e8..d55ab195e0 100644
--- a/client/src/components/Chat/Input/Files/ProgressCircle.tsx
+++ b/packages/chat/src/components/composer/files/ProgressCircle.tsx
@@ -6,7 +6,7 @@ export default function ProgressCircle({
circumference: number;
offset: number;
circleCSSProperties: React.CSSProperties;
-}) {
+}): React.JSX.Element {
return (