feat: search

This commit is contained in:
Philipinho
2024-01-30 00:14:21 +01:00
parent e0e5f7c43d
commit a0ec2f30ca
22 changed files with 509 additions and 161 deletions

View File

@ -0,0 +1,11 @@
import { useQuery, UseQueryResult } from '@tanstack/react-query';
import { searchPage } from '@/features/search/services/search-service';
import { IPageSearch } from '@/features/search/types/search.types';
export function usePageSearchQuery(query: string): UseQueryResult<IPageSearch[], Error> {
return useQuery({
queryKey: ['page-history', query],
queryFn: () => searchPage(query),
enabled: !!query,
});
}