// React Query option builders for blog feature procedures.
// Consumed by apps via the @repo/core-trpc client.

type TrpcClient = {
  blog: {
    articleBySlug: {
      queryOptions: (input: { slug: string }) => unknown;
    };
    listArticles: {
      queryOptions: (input?: {
        status?: string;
        authorId?: string;
        limit?: number;
        offset?: number;
      }) => unknown;
    };
  };
};

export function articleBySlugQuery(client: TrpcClient, slug: string) {
  return client.blog.articleBySlug.queryOptions({ slug });
}

export function listArticlesQuery(
  client: TrpcClient,
  options?: {
    status?: string;
    authorId?: string;
    limit?: number;
    offset?: number;
  },
) {
  return client.blog.listArticles.queryOptions(options);
}
