import { queryOptions } from '@tanstack/react-query'
import { getBlocks, getDomainBlocks, getMutes } from 'src/lib/api'
import { queryKeys } from './keys'

export const privacyQueries = {
  blockedAccounts: () =>
    queryOptions({
      queryKey: queryKeys.privacy.blocked(),
      queryFn: getBlocks,
      staleTime: 5 * 60 * 1000,
      gcTime: 60 * 60 * 1000,
    }),

  blockedDomains: () =>
    queryOptions({
      queryKey: queryKeys.privacy.blockedDomains(),
      queryFn: getDomainBlocks,
      staleTime: 5 * 60 * 1000,
      gcTime: 60 * 60 * 1000,
    }),

  mutedAccounts: () =>
    queryOptions({
      queryKey: queryKeys.privacy.muted(),
      queryFn: getMutes,
      staleTime: 5 * 60 * 1000,
      gcTime: 60 * 60 * 1000,
    }),
}
