
<template>
    <div @click="closeModal" class="modal fade scrollbar-none" :class="{ 'show': display , 'd-block': display , 'bg-dark bg-opacity-50' : display  }"  id="modalCenter" tabindex="-1" aria-modal="true" role="dialog">
        <div @click.stop class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title m-auto fw-bold" id="modalCenterTitle">
                        <slot name="title">Modal Title</slot>
                    </h5>
                </div>
                <div class="modal-body">
                    <slot name="body">Modal body</slot>
                </div>
                <div class="modal-footer">
                    <slot name="footer">Modal foot</slot>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>

const prop = defineProps({
    display : {
        type: Boolean,
        default: false,
        required: true,
    },
    create: {
        type: Boolean,
        default: false,
    }
});

const emit = defineEmits(['close' , 'reset']);

const closeModal = () => {
    if (prop.create) {
        emit('reset');
    }

    emit('close', false);
};
</script>






