import { computed } from 'mobx';
import { useStore } from 'stores/hooks';

export function useRowValue(index) {
  const { $tables } = useStore();

  const storeValue = computed(() => $tables.payments.getValue(index)).get();

  function setStoreValue(value) {
    $tables.payments.setValue(index, value);
  }

  return [storeValue, setStoreValue];
}

export function useRowStatus(index) {
  const { $tables } = useStore();

  const status = computed(() => $tables.payments.getStatus(index)).get();

  return status;
}
