import { Button, Result } from "antd";
import React from "react";

export default function ErrorResultAtom({
  title,
  errorMessage,
  tryAgainCallback,
}) {
  return (
    <Result
      status="500"
      title={title}
      subTitle={errorMessage}
      extra={
        tryAgainCallback ? (
          <Button type="primary" onClick={() => tryAgainCallback()}>
            Try Again
          </Button>
        ) : null
      }
    />
  );
}
