remove date, block global search for audio, video and documents

This commit is contained in:
smanylov
2026-02-26 19:32:57 +07:00
parent d2161fe221
commit 3b3e18f22d
4 changed files with 18 additions and 14 deletions
+7 -2
View File
@@ -6,6 +6,7 @@ import { useQueryClient } from '@tanstack/react-query';
import { Pagination } from '@/app/components/Pagination';
import { useTranslations } from 'next-intl';
import { AllowedExtensions } from '@/app/ui/search/section-search-file';
import { getFileType } from '@/app/lib/getFileType';
export interface SearchItem {
url: string,
@@ -29,7 +30,11 @@ export interface FileInfo {
url: string
}
export function FileSearchPanel({ fileId, ref, allowedExtensions }: { fileId: string | null, ref: any, allowedExtensions: AllowedExtensions }) {
export function FileSearchPanel(
{ fileId, ref, allowedExtensions, fileType }
:
{ fileId: string | null, ref: any, allowedExtensions: AllowedExtensions, fileType: string | null }
) {
const [searchedUserFiles, setSearchedUserFiles] = useState<FileInfo[]>([]);
const [searchedUserFilesShowNull, setSearchedUserFilesShowNull] = useState<boolean>(false);
const [searchedGlobalFiles, setSearchedGlobalFiles] = useState<SearchItem[]>([]);
@@ -63,7 +68,7 @@ export function FileSearchPanel({ fileId, ref, allowedExtensions }: { fileId: st
try {
let result = await searchUserFiles(fileId);
if (result.content.length) {
if (result.content.length && fileType === 'image') {
setSearchedUserFiles(result.content);
setShowGlobalSearch(true);
handlerSearchGlobalFile(fileId, page);