import { queryOptions } from '@tanstack/react-query';
import Api from '../api/Api';

export const postsQueryOptions = (page?: number) =>
  queryOptions({
    queryKey: ['posts', { page: page ?? 0, hasAuth: Api.hasAuth() }],
    queryFn: () => Api.posts(page),
  });
