import { useQuery } from '@tanstack/react-query'
import { getProductPrices } from '../api/getProductPrices'

export function useProductPrices(productId: number) {
  return useQuery({
    queryKey: ['products', productId, 'prices'],
    queryFn: () => getProductPrices(productId),
    enabled: productId > 0,
    staleTime: 30_000,
  })
}
