import { useAsyncError } from 'react-router'

export const ErrorAwait = () => {
  const error = useAsyncError()
  return (
    <p>
      {error instanceof Error ? error.message : 'An unexpected error occurred.'}
    </p>
  )
}
