lasthourcloud/resources/views/components/modal.blade.php

56 lines
2.6 KiB
PHP
Raw Normal View History

2023-07-13 11:16:24 +00:00
<dialog id="{{ $modalId }}" class="modal">
@if ($yesOrNo)
2023-12-07 18:06:32 +00:00
<form method="dialog" class="rounded modal-box" @if (!$noSubmit) wire:submit='submit' @endif>
2023-07-13 11:16:24 +00:00
<div class="flex items-start">
<div class="flex items-center justify-center flex-shrink-0 w-10 h-10 mr-4 rounded-full">
<svg class="w-8 h-8 text-error" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
2023-08-11 18:19:42 +00:00
stroke="currentColor" aria-hidden="true">
2023-07-13 11:16:24 +00:00
<path stroke-linecap="round" stroke-linejoin="round"
2023-08-11 18:19:42 +00:00
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
2023-07-13 11:16:24 +00:00
</svg>
</div>
<div class="flex flex-col w-full gap-2">
2023-08-07 16:46:40 +00:00
@isset($modalTitle)
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
@endisset
2023-07-13 11:16:24 +00:00
@isset($modalBody)
{{ $modalBody }}
@endisset
@if ($modalSubmit)
{{ $modalSubmit }}
@else
<div class="flex gap-4 mt-4">
<x-forms.button class="w-24 bg-coolgray-200 hover:bg-coolgray-100" type="button"
2023-08-11 18:19:42 +00:00
onclick="{{ $modalId }}.close()">Cancel
2023-07-13 11:16:24 +00:00
</x-forms.button>
<div class="flex-1"></div>
<x-forms.button class="w-24" isError type="button"
2023-08-11 18:19:42 +00:00
wire:click.prevent='{{ $action }}' onclick="{{ $modalId }}.close()">Continue
2023-07-13 11:16:24 +00:00
</x-forms.button>
</div>
@endif
</div>
</div>
</form>
@else
2023-08-07 16:46:40 +00:00
<form method="dialog" class="flex flex-col w-11/12 max-w-5xl gap-2 rounded modal-box"
2023-12-07 18:06:32 +00:00
@if ($submitWireAction) wire:submit={{ $submitWireAction }} @endif
@if (!$noSubmit && !$submitWireAction) wire:submit='submit' @endif>
2023-08-07 16:46:40 +00:00
@isset($modalTitle)
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
@endisset
2023-07-13 11:16:24 +00:00
@isset($modalBody)
{{ $modalBody }}
@endisset
@if ($modalSubmit)
{{ $modalSubmit }}
@endif
</form>
@endif
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>