Shared: Selectors: Added return new field.

This commit is contained in:
Tatiana Lopaeva 2024-05-20 10:23:33 +03:00
parent 02fb8738ce
commit 5feca2b857
2 changed files with 5 additions and 1 deletions

View File

@ -97,7 +97,8 @@ export const convertFilesToItems: (
filterParam?: string,
) => {
const items = files.map((file) => {
const { id, title, security, folderId, rootFolderType, fileExst } = file;
const { id, title, security, folderId, rootFolderType, fileExst, viewUrl } =
file;
const icon = getIcon(fileExst || DEFAULT_FILE_EXTS);
const label = title.replace(fileExst, "") || fileExst;
@ -112,6 +113,7 @@ export const convertFilesToItems: (
rootFolderType,
isDisabled: !filterParam,
fileExst,
viewUrl,
};
});
return items;

View File

@ -127,6 +127,7 @@ const FilesSelector = ({
title: string;
path?: string[];
fileExst?: string;
viewUrl?: string;
inPublic?: boolean;
} | null>(null);
const [total, setTotal] = React.useState<number>(0);
@ -261,6 +262,7 @@ const FilesSelector = ({
id: item.id,
title: item.label,
fileExst: item.fileExst,
viewUrl: item.viewUrl,
inPublic,
});