<template>
    <div class="row">
        <div class="col bg-white padding-40 b-rad-lg">
            <loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
            <div class="row justify-content-center" v-show="!isLoading">
                <div class="col">
                    <div class="row m-b-20">
                        <div class="col">
                            <h3 class="all-caps">Are you Sure?</h3>
                            <div class="fs-11">Ensure PO details are fill in correctly — NO changes allowed after submission.</div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col p-r-5">
                            <div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Re-Check Again</div>
                        </div>
                        <div class="col p-l-5">
                            <div class="btn btn-sm btn-danger btn-block b-rad-none" @click="handleClick">Confirm Submit</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { useFormHandler } from '@/composables/useFormHandler';

const props = defineProps<{
    section: string;
}>();

const emit = defineEmits(['confirm-submit']);

const { isLoading, closeModal } = useFormHandler({ section: props.section });

const handleClick = () => {
    emit('confirm-submit', true);
    closeModal();
};
</script>
