2023-05-03 12:09:10 +00:00
|
|
|
@props([
|
2023-05-09 09:33:50 +00:00
|
|
|
'disabled' => null,
|
2023-05-03 12:09:10 +00:00
|
|
|
'confirm' => null,
|
|
|
|
'confirmAction' => null,
|
|
|
|
])
|
2023-05-17 13:46:20 +00:00
|
|
|
<button {{ $attributes }}
|
|
|
|
@if ($attributes->whereStartsWith('wire:click') && !$disabled) wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
|
|
|
|
wire:loading.delay.class='loading' wire:loading.delay.attr="disabled" @endif
|
|
|
|
@if ($disabled !== null) disabled title="{{ $disabled }}" @endif
|
2023-05-03 13:02:21 +00:00
|
|
|
@isset($confirm)
|
2023-05-04 13:45:53 +00:00
|
|
|
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
|
2023-05-03 13:02:21 +00:00
|
|
|
@endisset
|
|
|
|
@isset($confirmAction)
|
2023-05-04 13:45:53 +00:00
|
|
|
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
|
2023-05-03 13:02:21 +00:00
|
|
|
@endisset>
|
2023-05-03 12:09:10 +00:00
|
|
|
{{ $slot }}
|
|
|
|
</button>
|