import { useQuery } from '@tanstack/react-query'
import { getPaymentQuoteByRub } from '../api/paymentApi'
import type { PaymentQuote } from '../api/paymentApi'

export function usePaymentQuoteByRub(rubAmount: number) {
  return useQuery<PaymentQuote>({
    queryKey: ['payment', 'quote', 'rub', rubAmount],
    queryFn: () => getPaymentQuoteByRub(rubAmount),
    enabled: rubAmount > 0,
    staleTime: 30_000,
    retry: false,
  })
}
