import { defineStore } from 'pinia';
import { ref } from 'vue';

export const useDrillsStepsStore = defineStore('drillsSteps', () => {
  const drillsId = ref('');
  const planId = ref('');
  const stepsList = ref([]);

  function clearDrills() {
    drillsId.value = '';
    planId.value = '';
    stepsList.value = [];
  }

  function addElement(item) {
    stepsList.value.push(item)
  }

  function subtractLastElement() {
    stepsList.value.pop();
  }

  return {
    drillsId,
    planId,
    stepsList,
    addElement,
    subtractLastElement,
    clearDrills
  };

});