Files
solana/explorer/src/components/common/ErrorCard.tsx

37 lines
781 B
TypeScript
Raw Normal View History

2020-05-14 15:30:33 +08:00
import React from "react";
export default function ErrorCard({
retry,
2020-05-14 22:14:28 +08:00
retryText,
2020-05-14 15:30:33 +08:00
text
}: {
retry?: () => void;
2020-05-14 22:14:28 +08:00
retryText?: string;
2020-05-14 15:30:33 +08:00
text: string;
}) {
2020-05-14 22:14:28 +08:00
const buttonText = retryText || "Try Again";
2020-05-14 15:30:33 +08:00
return (
<div className="card">
<div className="card-body text-center">
{text}
{retry && (
<>
<span
className="btn btn-white ml-3 d-none d-md-inline"
onClick={retry}
>
2020-05-14 22:14:28 +08:00
{buttonText}
2020-05-14 15:30:33 +08:00
</span>
<div className="d-block d-md-none mt-4">
<hr></hr>
<span className="btn btn-white" onClick={retry}>
2020-05-14 22:14:28 +08:00
{buttonText}
2020-05-14 15:30:33 +08:00
</span>
</div>
</>
)}
</div>
</div>
);
}