import { queryOptions } from '@tanstack/react-query';
import { getCrmDashboard } from './service';
import type { CrmDashboardFilters } from './types';

export const crmDashboardKeys = {
  all: ['crm-dashboard'] as const,
  data: (filters: CrmDashboardFilters) => [...crmDashboardKeys.all, filters] as const
};

export const crmDashboardQueryOptions = (filters: CrmDashboardFilters) =>
  queryOptions({
    queryKey: crmDashboardKeys.data(filters),
    queryFn: () => getCrmDashboard(filters)
  });
