pleroma-fe/src/components/confirm_modal/confirm_modal.js
2026-06-10 02:12:03 +03:00

45 lines
954 B
JavaScript

import DialogModal from 'src/components/dialog_modal/dialog_modal.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons'
library.add(faCircleQuestion)
/**
* This component emits the following events:
* cancelled, emitted when the action should not be performed;
* accepted, emitted when the action should be performed;
*
* The caller should close this dialog after receiving any of the two events.
*/
const ConfirmModal = {
components: {
DialogModal,
},
props: {
title: {
type: String,
},
cancelText: {
type: String,
},
confirmText: {
type: String,
},
confirmDanger: {
type: Boolean,
},
},
emits: ['cancelled', 'accepted'],
computed: {},
methods: {
onCancel() {
this.$emit('cancelled')
},
onAccept() {
this.$emit('accepted')
},
},
}
export default ConfirmModal