import { useNavigate } from 'react-router-dom'

export function usePaymentNavigation() {
  const navigate = useNavigate()
  return {
    toCheckout() {
      window.location.assign('https://erpskrip.id/pembayaran-pelanggan')
    },
    toStatus(orderId: string, method?: string) {
      const qs = method ? `?m=${encodeURIComponent(method)}` : ''
      navigate(`/payments/${orderId}/status${qs}`)
    },
    toHistory() {
      navigate('/history')
    },
  }
}
