import { useStores } from '../useStores';

export const useStatus = elementName => {
  const { calculationStore } = useStores();
  const status = calculationStore.getStatus(elementName);
  return { status };
};

export const useTableStatus = ({ tableName, rowIndex, propName }) => {
  const { calculationStore } = useStores();
  const status = calculationStore.getTableRowValues(
    tableName,
    rowIndex,
    'status',
  )[propName];
  return { status };
};
