remove date, block global search for audio, video and documents
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user