import React, { FC, ReactNode } from 'react'; import { Button, Result } from 'antd'; type WithErrorProps = { children?: ReactNode; errorData?: any; refresh?: () => void; }; export const WithError: FC = ({ children, errorData, refresh }) => { if (errorData) { return ( Refresh page ) : undefined} /> ); } return children; };