import React from 'react'

const Error = ({error,close}) => {
  console.log(error)
  return (
      <div className="container text-center py-5">
      <h1 className="display-4 fw-bold text-danger">{error.statusCode || error?.response?.status
}</h1>
      <h2 className="mb-3">Internal Server Error</h2>
      <p className="lead">
        {error.message}
      </p>
      <a href="/" className="btn btn-primary btn-sm mt-3" onClick={()=>close()}>
        Go to Home
      </a>
    </div>
  )
}

export default Error