herbarium/resources/views/components/action-message.blade.php
Alyx Batte 5280d46d07
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
initial commit
2025-11-18 19:31:28 -05:00

15 lines
452 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']) }}
>
{{ $slot->isEmpty() ? __('Saved.') : $slot }}
</div>