@props([
'title' => 'Are you sure?',
'isErrorButton' => false,
'isHighlightedButton' => false,
'buttonTitle' => 'Confirm Action',
'buttonFullWidth' => false,
'customButton' => null,
'disabled' => false,
'submitAction' => 'delete',
'content' => null,
'checkboxes' => [],
'actions' => [],
'confirmWithText' => true,
'confirmationText' => 'Confirm Deletion',
'confirmationLabel' => 'Please confirm the execution of the actions by entering the Name below',
'shortConfirmationLabel' => 'Name',
'confirmWithPassword' => true,
'step1ButtonText' => 'Continue',
'step2ButtonText' => 'Continue',
'step3ButtonText' => 'Confirm',
'dispatchEvent' => false,
'dispatchEventType' => 'success',
'dispatchEventMessage' => '',
])
@php
use App\Models\InstanceSettings;
$disableTwoStepConfirmation = data_get(InstanceSettings::get(), 'disable_two_step_confirmation');
@endphp
@if ($customButton)
@if ($buttonFullWidth)
{{ $customButton }}
@else
{{ $customButton }}
@endif
@else
@if ($content)
{{ $content }}
@else
@if ($disabled)
@if ($buttonFullWidth)
{{ $buttonTitle }}
@else
{{ $buttonTitle }}
@endif
@elseif ($isErrorButton)
@if ($buttonFullWidth)
{{ $buttonTitle }}
@else
{{ $buttonTitle }}
@endif
@elseif($isHighlightedButton)
@if ($buttonFullWidth)
{{ $buttonTitle }}
@else
{{ $buttonTitle }}
@endif
@else
@if ($buttonFullWidth)
{{ $buttonTitle }}
@else
{{ $buttonTitle }}
@endif
@endif
@endif
@endif
@if (!empty($checkboxes))
Actions
@foreach ($checkboxes as $index => $checkbox)
@endforeach
Cancel
@endif
Warning
This operation is permanent and cannot be undone. Please think again before proceeding!
The following actions will be performed:
@foreach ($actions as $action)
-
{{ $action }}
@endforeach
@foreach ($checkboxes as $checkbox)
-
{{ $checkbox['label'] }}
@endforeach
@if (!$disableTwoStepConfirmation)
@if ($confirmWithText)
@endif
@endif
@if (!empty($checkboxes))
Back
@else
Cancel
@endif
@if (!$disableTwoStepConfirmation)
Final Confirmation
Please enter your password to confirm this destructive action.
@php
$passwordConfirm = Str::uuid();
@endphp
@error('password')
{{ $message }}
@enderror
Back
{
if (result === true) {
modalOpen = false;
resetModal();
} else {
passwordError = result;
password = ''; // Clear the password field
}
});
">
@endif