<template>
    <div class="msg-box-overlay" v-if="visible">
        <div class="content-wrapper">
            <div class="title">{{title}}</div>
            <div class="desc">{{content}}</div>
            <div class="btn-wrapper">
                <div class="btn cancel" @click="cancel">
                    {{cancelText}}
                </div>
                <div class="btn confirm" @click="confirm">
                    {{confirmText}}
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
/* eslint-disable */
import { defineEmits, defineProps } from "vue";
const props = defineProps({
    visible: {
        type: Boolean,
        default: false,
    },
    title: {
        type: String,
        default: ''
    },
    content: {
        type: String,
        default: ''
    },
    cancelText: {
        type: String, 
        default: 'Cancel'
    },
    confirmText: {
        type: String, 
        default: 'Confirm'
    }
});

const emits = defineEmits(["cancel", "confirm"]);


const cancel = () => {
    emits("cancel", {});
};

const confirm = () => {
    emits("confirm", {});
};

</script>

<style lang="scss" scoped>
.msg-box-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;

    .content-wrapper {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 335px;
        min-height: 190px;
        background: #FFFFFF;
        border-radius: 20px;
        padding: 20px 13px;
        box-sizing: border-box;
        transform: translate(-50%, -50%);
        text-align: center;

        .title {
            font-weight: 600;
            font-size: 18px;
            margin-bottom: 13px;
        }
        .desc {
            min-height: 44px;
            font-weight: 400;
            font-size: 15px;
            margin-bottom: 20px;
        }
        .btn-wrapper {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .btn {
                width: 150px;
                height: 46px;
                border-radius: 100px;
                box-sizing: border-box;
                font-weight: 600;
                font-size: 16px;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .cancel {
                color: #fff;
                background: #FF0000;
            }
            .confirm {
                color: #000;
                border: 1px solid #000000;
            }
        }
    }
}
</style>
