Feat: Files uploaded via the dialog box can be uploaded without binding to a dataset. #9590 (#11630)

### What problem does this PR solve?

Feat: Files uploaded via the dialog box can be uploaded without binding
to a dataset. #9590

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-12-01 16:29:02 +08:00
committed by GitHub
parent 221947acc4
commit 1120575021
11 changed files with 60 additions and 466 deletions

View File

@ -1,13 +1,13 @@
import { UploadResponseDataType } from '@/interfaces/database/chat';
import { IDocumentInfo } from '@/interfaces/database/document';
import { getExtension } from '@/utils/document-util';
import { formatBytes } from '@/utils/file-util';
import { memo } from 'react';
import FileIcon from '../file-icon';
import NewDocumentLink from '../new-document-link';
import SvgIcon from '../svg-icon';
interface IProps {
files?: File[] | IDocumentInfo[];
files?: File[] | IDocumentInfo[] | UploadResponseDataType[];
}
type NameWidgetType = {
@ -15,16 +15,16 @@ type NameWidgetType = {
size: number;
id?: string;
};
function NameWidget({ name, size, id }: NameWidgetType) {
function NameWidget({ name, size }: NameWidgetType) {
return (
<div className="text-xs max-w-20">
{id ? (
{/* {id ? (
<NewDocumentLink documentId={id} documentName={name} prefix="document">
{name}
</NewDocumentLink>
) : (
<div className="truncate">{name}</div>
)}
)} */}
<div className="truncate">{name}</div>
<p className="text-text-secondary pt-1">{formatBytes(size)}</p>
</div>
);