import React from "react";

import ErrorBoundary from "./ErrorBoundary";

const withErrors = (Component) => {
  const Wrapped = (props) => (
    <ErrorBoundary>
      <Component {...props} />
    </ErrorBoundary>
  );
  return Wrapped;
};

export default withErrors;
