This commit is contained in:
Andras Bacsai 2023-06-01 08:22:13 +02:00
parent 2d9db6d9cb
commit 7138eb4b69

View File

@ -1,30 +0,0 @@
@props([
'type' => $attributes->get('type') ?? 'button',
'disabled' => null,
'confirm' => null,
'confirmAction' => null,
])
@if ($type === 'submit')
<button {{ $attributes }} type="submit" @disabled($disabled) wire:target="submit"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
@elseif($type === 'button')
<button {{ $attributes }} @disabled($disabled) type="button"
wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
@endif