32 lines
663 B
JavaScript
32 lines
663 B
JavaScript
import { useStore } from 'stores/hooks';
|
|
|
|
export function useRowValue(key, valueName) {
|
|
const { $tables } = useStore();
|
|
|
|
const storeValue = $tables.insurance.getRowValue(key, valueName);
|
|
|
|
function setStoreValue(value) {
|
|
$tables.insurance.setRowValues(key, {
|
|
[valueName]: value,
|
|
});
|
|
}
|
|
|
|
return [storeValue, setStoreValue];
|
|
}
|
|
|
|
export function useRowOptions(key) {
|
|
const { $tables } = useStore();
|
|
|
|
const rowOptions = $tables.insurance.getRowOptions(key);
|
|
|
|
return rowOptions;
|
|
}
|
|
|
|
export function useRowStatuses(key) {
|
|
const { $tables } = useStore();
|
|
|
|
const rowStatuses = $tables.insurance.getRowStatuses(key);
|
|
|
|
return rowStatuses;
|
|
}
|