action-message.blade.php 474 B

12345678910
  1. @props(['on'])
  2. <div x-data="{ shown: false, timeout: null }"
  3. x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
  4. x-show.transition.out.opacity.duration.1500ms="shown"
  5. x-transition:leave.opacity.duration.1500ms
  6. style="display: none;"
  7. {{ $attributes->merge(['class' => 'text-sm text-gray-600 dark:text-gray-400']) }}>
  8. {{ $slot->isEmpty() ? 'Saved.' : $slot }}
  9. </div>