<template>
    <u-modal :show="show" :title="title" :content="content" :closeOnClickOverlay="true" @close="handleToggle"></u-modal>
</template>

<script setup lang='ts'>
import { useToggle } from '@/hooks/useLockFn';
import { ref } from 'vue';

interface ModalProps {
    content: string
}
const props = defineProps({
    title: {
        type: String
    }
})
const { show, handleToggle } = useToggle()

const content = ref('')

const openModal = (params: ModalProps) => {
    const { content: text } = params
    content.value = text
    handleToggle()
}
defineExpose({
    openModal
})
</script>
<style scoped></style>