🎨 Make the Alert component anonymous

This commit is contained in:
Brandon
2024-01-04 12:05:48 -06:00
parent 5cd2c43847
commit 5b07f46c2c
2 changed files with 13 additions and 58 deletions

View File

@@ -1,3 +1,15 @@
<div {{ $attributes->merge(['class' => $type]) }}>
@props([
'type' => null,
'message' => null,
])
@php($class = match ($type) {
'success' => 'text-green-50 bg-green-400',
'caution' => 'text-yellow-50 bg-yellow-400',
'warning' => 'text-red-50 bg-red-400',
default => 'text-indigo-50 bg-indigo-400',
})
<div {{ $attributes->merge(['class' => "px-2 py-1 {$class}"]) }}>
{!! $message ?? $slot !!}
</div>