<template>
    <div class="join-group-overlay" :style="{'position': position}" v-if="dialogVisible">
        <div class="content-wrapper" :style="contentStyle">
            <img :src="require('@/assets/svg/icon-celebration.svg')" 
                class="icon-celebration"
                :style="iconStyle">
            <div class="desc" :style="descStyle">{{content}}</div>
            <div class="btn-wrapper">
                <div class="btn confirm" @click="confirm">Finish</div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { defineEmits, defineProps } from "vue";
defineProps({
    dialogVisible: {
        type: Boolean,
        default: false,
    },
    content: {
        type: String,
        default: 'Joined Successfully'
    },
    position: {
        type: String,
        default: 'fixed'
    },
    contentStyle: {
        type: Object,
        default: () => {
            return {}
        }
    },
    iconStyle: {
        type: Object,
        default: () => {
            return {}
        }
    },
    descStyle: {
        type: Object,
        default: () => {
            return {}
        }
    }
});

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

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

</script>

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

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

        .icon-celebration {
            width: 120px;
            margin-top: 60px;
        }

        .desc {
            font-weight: 600;
            font-size: 22px;
            margin-top: 36px;
            margin-bottom: 58px;
        }

        .btn-wrapper {
            display: flex;
            align-items: center;
            justify-content: space-between;
            .confirm {
                width: 100%;
                padding: 14px;
                box-sizing: border-box;
                background: #1D9BF0;
                color: #fff;
                border-radius: 100px;
                font-weight: 600;
                font-size: 16px;
                cursor: pointer;
                margin: 0px 20px 20px 20px;
            }
        }
    }
}
</style>
