<script setup>
import { PlusIcon } from "@heroicons/vue/24/solid";
import SecondaryButton from "@/components/Buttons/SecondaryButton.vue";
import { useSettingsStore } from "@/stores/SettingsStore";
import { storeToRefs } from "pinia";

const { gateSettings } = storeToRefs(useSettingsStore());

const addNewRule = () => {
    gateSettings.value.push({
        enabled: true,
        rule: "is_in_line_category",
        condition: null,
        integration: null,
        warehouse: null,
        payment_type: null,
        payor_type: null,
        pay_at_door: false,
    });
};
</script>
<template>
    <SecondaryButton @click="addNewRule">
        <PlusIcon class="w-4 h-4" />
        {{ $t("add_new_rule") }}
    </SecondaryButton>
</template>