<template>
	<view v-if="showPopup" class="popup-mask">
		<view class="popup-content">
			<view class="close-button" @click="closePopup">×</view>
			<slot></slot>
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			showPopup: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			closePopup() {
				this.$emit('close');
			}
		}
	};
</script>
<style>
	.popup-mask {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.popup-content {
		/* Styling for the popup content */
		background-color: rgba(255, 255, 255, 0.8);
		width: 100%;
		height: 60%;
		padding: 30rpx;
	}

	.close-button {
		position: absolute;
		top: 10px;
		right: 10px;
		font-size: 20px;
		color: #fff;
		cursor: pointer;
		width: 46rpx;
		height: 46rpx;
		line-height: 46rpx;
		text-align: center;
		border-radius: 23rpx;
		background-color: rgba(255, 255, 255, 0.3);
	}
</style>