import { queryOptions } from '@tanstack/react-query'
import { getLocalTimelinePosts, getTrendingHashtags } from 'src/lib/api'
import { queryKeys } from './keys'

export const discoverQueries = {
  trendingHashtags: () =>
    queryOptions({
      queryKey: queryKeys.discover.trendingHashtags(),
      queryFn: getTrendingHashtags,
      staleTime: 10 * 60 * 1000,
      gcTime: 60 * 60 * 1000,
    }),

  localTimeline: () =>
    queryOptions({
      queryKey: queryKeys.discover.localTimeline(),
      queryFn: getLocalTimelinePosts,
      staleTime: 2 * 60 * 1000,
      gcTime: 30 * 60 * 1000,
    }),
}
