<script setup>
import ConfirmDialog from "primevue/confirmdialog";
</script>

<template>
	<ConfirmDialog>
		<template #message="slotProps">
			<div class="p-dialog-content " v-if="slotProps.message.message.startsWith('html:')">
				<i class="p-confirmdialog-icon"
				   v-if="typeof slotProps.message.icon === 'string' &&slotProps.message.icon.length > 0"
				   :class="slotProps.message.icon"></i>
				<span v-html="slotProps.message.message.substring('html:'.length)"></span>
			</div>
			<div v-else class="p-dialog-content">
				<i class="p-confirmdialog-icon"
				   v-if="typeof slotProps.message.icon === 'string' &&slotProps.message.icon.length > 0"
				   :class="slotProps.message.icon"></i>
				<span class="p-confirmdialog-message">{{ slotProps.message.message }}</span>
			</div>
		</template>
	</ConfirmDialog>
</template>

<style scoped>
.p-confirmdialog .p-dialog-content {
	align-items: center;
}

.p-confirmdialog .p-confirmdialog-message {
	word-break: break-all;
}
</style>
