mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
14 lines
466 B
PHP
14 lines
466 B
PHP
@props([
|
|
'on',
|
|
])
|
|
|
|
<div
|
|
x-data="{ shown: false, timeout: null }"
|
|
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
|
|
x-show.transition.out.opacity.duration.1500ms="shown"
|
|
x-transition:leave.opacity.duration.1500ms
|
|
style="display: none"
|
|
{{ $attributes->merge(['class' => 'text-sm text-gray-600']) }}
|
|
>
|
|
{{ $slot->isEmpty() ? __('Saved.') : $slot }}
|
|
</div>
|