import React, { useEffect } from 'react'
import {useLocation, useNavigate} from 'react-router-dom'
import TransactionDetailsCom from '../components/transactionDetails/TransactionDetailsCom'


export default function TransactionDetailsPage() {
  const {state} = useLocation()
  const navigate = useNavigate()

  useEffect(()=>{
    if(!state?.transactionID){
        navigate('/', {replace: true})
    }
  },[state])
  return (
    <TransactionDetailsCom id={state?.transactionID} />
  )
}
