import { queryOptions } from '@tanstack/react-query';
import { getNotifications } from './service';
import type { NotificationFilters, NotificationItem } from './types';

export type { NotificationItem };

export const notificationKeys = {
  all: ['notifications'] as const,
  list: (filters: NotificationFilters) => [...notificationKeys.all, 'list', filters] as const
};

export const notificationsQueryOptions = (filters: NotificationFilters) =>
  queryOptions({
    queryKey: notificationKeys.list(filters),
    queryFn: () => getNotifications(filters)
  });
