mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-14 05:24:24 +01:00
* refactor: streamline model preset handling in conversation setup * refactor: integrate navigation and location hooks in chat functions and event handlers, prevent cache from fetching on final event handling * fix: prevent adding code interpreter non-image output to file list on message attachment event, fix all unhandled edge cases when this is done (treating the file download as an image attachment, undefined fields, message tokenCount issues, use of `startsWith` on undefined "text") although it is now prevent altogether * chore: remove unused jailbreak prop from MinimalIcon component in EndpointIcon * feat: add new SVG icons (MobileSidebar, Sidebar, XAIcon), fix: xAI styling in dark vs. light modes, adjust styling of Landing icons * fix: open conversation in new tab on navigation with ctrl/meta key * refactor: update Nav & Header to use close/open sidebar buttons, as well as redesign "New Chat"/"Bookmarks" buttons to the top of the Nav, matching the latest design of ChatGPT for simplicity and to free up space * chore: remove unused isToggleHovering state and simplify opacity logic in Nav component * style: match mobile nav to mobile header
28 lines
1,007 B
TypeScript
28 lines
1,007 B
TypeScript
import type { Row } from '@tanstack/react-table';
|
|
import type { TFile } from 'librechat-data-provider';
|
|
import ImagePreview from '~/components/Chat/Input/Files/ImagePreview';
|
|
import FilePreview from '~/components/Chat/Input/Files/FilePreview';
|
|
import { getFileType } from '~/utils';
|
|
|
|
export default function PanelFileCell({ row }: { row: Row<TFile | undefined> }) {
|
|
const file = row.original;
|
|
return (
|
|
<div className="flex w-full items-center gap-2">
|
|
{file?.type?.startsWith('image') === true ? (
|
|
<ImagePreview
|
|
url={file.filepath}
|
|
className="h-10 w-10 flex-shrink-0"
|
|
source={file.source}
|
|
alt={file.filename}
|
|
/>
|
|
) : (
|
|
<FilePreview fileType={getFileType(file?.type)} file={file} />
|
|
)}
|
|
<div className="min-w-0 flex-1 overflow-hidden">
|
|
<span className="block w-full overflow-hidden truncate text-ellipsis whitespace-nowrap text-xs">
|
|
{file?.filename}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|