import { useStatus } from 'client/hooks/Calculation/useStatus';
import { useUrl } from 'client/hooks/Calculation/useUrl';
import { observer } from 'mobx-react-lite';

export default ({ name, valueName: urlName, Component, ...props }) =>
  observer(() => {
    const { status } = useStatus(name);
    const { url } = useUrl({ urlName });

    return <Component status={status} {...props} url={url} />;
  });
