Files
imexrps/src/components/atoms/error-result/error-result.atom.jsx
2020-10-22 20:57:01 -07:00

32 lines
653 B
JavaScript

import { Button, Result } from "antd";
import React from "react";
import ipcTypes from "../../../ipc.types";
const { ipcRenderer } = window;
export default function ErrorResultAtom({
title,
errorMessage,
tryAgainCallback,
}) {
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
event: "ERROR_RESULT_ATOM_DISPLAYED",
title,
errorMessage,
});
return (
<Result
status="500"
title={title}
subTitle={errorMessage}
extra={
tryAgainCallback ? (
<Button type="primary" onClick={() => tryAgainCallback()}>
Try Again
</Button>
) : null
}
/>
);
}