<script setup>
import {ref} from "vue";
import ICON from "../static/icons/prompt.png";
import XConfirmModal from "./XConfirmModal.vue";

const show = ref(false);
</script>

<template>
    <image v-if="!$slots.button" class="!size-[24rpx]" :src="ICON" mode="aspectFill" @click="show=true"></image>
    <Text v-else @click="show=true">
        <slot name="button"></slot>
    </Text>

    <x-confirm-modal
        width="500rpx"
        v-bind="$attrs"
        :cancel="false"
        confirm-text="知道了"
        v-model:show="show">
        <template #info v-if="$slots.info">
            <slot name="info"></slot>
        </template>
    </x-confirm-modal>
</template>

<style scoped lang="scss">

</style>
