import {keepPreviousData, useQuery} from "@tanstack/react-query"; import {fetchContentList} from "../../api/contentApi.ts"; import type {SearchParams} from "../../../../../type/searchParams.ts"; import {createPageQueryResult} from "../../../../../type/pageResponse.ts"; export const useContentList = (searchParams: SearchParams) => { const query = useQuery({ queryKey: ['contentList', searchParams], queryFn: () => fetchContentList(searchParams), placeholderData: keepPreviousData }); return createPageQueryResult(query); }