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

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