diff --git a/src/dispatch/static/dispatch/src/components/SavingState.vue b/src/dispatch/static/dispatch/src/components/SavingState.vue new file mode 100644 index 000000000000..2732da330f4c --- /dev/null +++ b/src/dispatch/static/dispatch/src/components/SavingState.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/dispatch/static/dispatch/src/composables/useSavingState.ts b/src/dispatch/static/dispatch/src/composables/useSavingState.ts new file mode 100644 index 000000000000..f8c8de3f9b52 --- /dev/null +++ b/src/dispatch/static/dispatch/src/composables/useSavingState.ts @@ -0,0 +1,25 @@ +import { computed, ComputedRef } from "vue" +import { useStore } from "vuex" +import { Store } from "vuex" +import { CaseState } from "@/store/case" + +interface UseSavingStateReturns { + saving: ComputedRef + // eslint-disable-next-line no-unused-vars + setSaving: (value: boolean) => void +} + +export function useSavingState(): UseSavingStateReturns { + const store = useStore>() + + const saving = computed(() => store.state.case_management.selected.saving) + + const setSaving = (value: boolean) => { + store.commit("case_management/SET_SELECTED_SAVING", value) + } + + return { + saving, + setSaving, + } +}