// Delete Confirmation Modal Component
const DeleteConfirmationModalComponent = {
	template: `
	< p > TESssssssss < / p >
	< div id                           = "delete-confirmation-modal" class = "modal active" >
		< div class                    = "modal-content" >
		< header class                 = "modal-header" >
			< h3 > Delete Confirmation < / h3 >
		< / header >
		< div class                    = "modal-body" >
			< p > Are you sure you want to delete this post ? Deleting will refund credits.< / p >
		< / div >
		< footer class                 = "modal-footer" >
			< button class             = "btn btn-danger" @click = "$emit('confirm')" > Yes, Delete < / button >
			< button class             = "btn btn-secondary" @click = "$emit('cancel')" > Cancel < / button >
		< / footer >
		< / div >
	< / div >
	`
};

// Check if we're in a Vue 2 or Vue 3 environment
if (typeof Vue !== 'undefined') {
	if (Vue.createApp) {
		// Vue 3
		if (typeof app !== 'undefined') {
			// If app is already defined, register the component
			app.component( 'delete-confirmation-modal', DeleteConfirmationModalComponent );
		} else {
			// Otherwise, create a new app and register the component
			const app = Vue.createApp( {} );
			app.component( 'delete-confirmation-modal', DeleteConfirmationModalComponent );
			// Note: You'll need to mount this app to an element
		}
	} else if (Vue.component) {
		// Vue 2
		Vue.component( 'delete-confirmation-modal', DeleteConfirmationModalComponent );
	}
}
