MsgError.tsx 491 B

1234567891011121314151617181920212223
  1. import { Alert, Button } from "antd";
  2. import { ReloadOutlined } from "@ant-design/icons";
  3. interface IWidget {
  4. message?: string;
  5. onRefresh?: () => void;
  6. }
  7. const MsgError = ({ message, onRefresh }: IWidget) => {
  8. return (
  9. <Alert
  10. type="error"
  11. closable={false}
  12. showIcon
  13. message={message}
  14. action={
  15. <Button type="text" icon={<ReloadOutlined />} onClick={onRefresh}>
  16. 刷新
  17. </Button>
  18. }
  19. />
  20. );
  21. };
  22. export default MsgError;