better iterface

This commit is contained in:
m
2026-09-10 06:46:22 +02:00
parent 27d4eb6a65
commit 8ff2339c8a
14 changed files with 498 additions and 43 deletions
+14
View File
@@ -0,0 +1,14 @@
import { useQuery } from '@tanstack/react-query';
import { api } from '../api/client';
import type { FileDto } from '../api/types';
export function useSearch(q: string, page?: number, pageSize?: number) {
const trimmed = q.trim();
return useQuery({
queryKey: ['search', trimmed, page, pageSize],
queryFn: () => api.searchFiles(trimmed, { page, pageSize }),
enabled: trimmed.length > 0,
});
}
export type { FileDto };