import { useQuery } from '@tanstack/react-query'
import { listProductTypes } from '../api/listProductTypes'
import type { ListProductTypesParams } from '../types'

export function useProductTypes(params?: ListProductTypesParams) {
  return useQuery({
    queryKey: ['product-types', params],
    queryFn: () => listProductTypes(params),
  })
}
