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

export default ({ name, valueName: actionName, Component, ...props }) =>
  observer(() => {
    const { status } = useStatus(name);
    const { action } = useAction({ actionName });

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