CopyToResult.tsx 829 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Button, Result } from "antd";
  2. interface IWidget {
  3. total?: number;
  4. onClose?: Function;
  5. onInit?: Function;
  6. }
  7. const CopyToResult = ({ total, onClose, onInit }: IWidget) => {
  8. return (
  9. <Result
  10. status="success"
  11. title="Successfully Copied!"
  12. subTitle={`Sentence: ${total}`}
  13. extra={[
  14. <Button
  15. key="init"
  16. onClick={() => {
  17. if (typeof onInit !== "undefined") {
  18. onInit();
  19. }
  20. }}
  21. >
  22. 从新开始
  23. </Button>,
  24. <Button
  25. key="close"
  26. type="primary"
  27. onClick={() => {
  28. if (typeof onClose !== "undefined") {
  29. onClose();
  30. }
  31. }}
  32. >
  33. 关闭
  34. </Button>,
  35. ]}
  36. />
  37. );
  38. };
  39. export default CopyToResult;