import {keepPreviousData, useQuery} from '@tanstack/react-query'; import {fetchContentDetail} from '../../api/contentApi.ts'; type UseContentDetailOptions = { enabled: boolean; }; export const useContentDetail = ( cntId: string, cntDtId: string, options?: UseContentDetailOptions, ) => { return useQuery({ queryKey: ['contentDetail', cntId, cntDtId], queryFn: () => fetchContentDetail({cntId, cntDtId}), placeholderData: keepPreviousData, enabled: options?.enabled ?? true, }); };