<script setup lang="ts">
import { ref } from 'vue';
import { RowApproveAction } from '@/components/button';
import { useCan } from '@/composables/useCan';
import type { CuttingListItem } from '@/types/cutting';
import StockVerifyDialog from './StockVerifyDialog.vue';

defineProps<{
    cutting: CuttingListItem;
}>();

const { can } = useCan();

const verifyDialogOpen = ref(false);
</script>

<template>
    <RowApproveAction v-if="can('cuttings.verify')" size="sm" tooltip="Verifikasi & Tambah Stok"
        @click="verifyDialogOpen = true" />

    <StockVerifyDialog v-model:open="verifyDialogOpen" :cutting="cutting" />
</template>
