@php use Filament\Support\Enums\Alignment; $titleAlignment = $notification->getTitleAlignment(); $bodyAlignment = $notification->getBodyAlignment(); $title = $notification->getTitle(); $body = $notification->getBody(); $actions = $notification->getActions(); $color = $notification->getColor(); if (! $titleAlignment instanceof Alignment) { $titleAlignment = filled($titleAlignment) ? (Alignment::tryFrom($titleAlignment) ?? $titleAlignment) : null; } if (! $bodyAlignment instanceof Alignment) { $bodyAlignment = filled($bodyAlignment) ? (Alignment::tryFrom($bodyAlignment) ?? $bodyAlignment) : null; } $colorClasses = \Illuminate\Support\Arr::toCssClasses(['flex items-center border border-transparent px-6 py-2 gap-4', 'bg-white text-gray-950 dark:bg-white/5 dark:text-white' => $color === 'gray', 'bg-custom-600 text-white dark:bg-custom-500' => $color !== 'gray']); $colorStyles = \Illuminate\Support\Arr::toCssStyles([ \Filament\Support\get_color_css_variables($color, shades: [400, 500, 600]) => $color !== 'gray', ]); if (gettype($color) == 'string') { $colorStyles = "--c-400:$color;--c-500:$color;--c-600:$color;"; } @endphp
@if ($icon = $notification->getIcon())
@endif
@if ($title && ! $body && $actions)
'justify-start', Alignment::Center => 'justify-center', Alignment::End, Alignment::Right => 'justify-end', Alignment::Between, Alignment::Justify => 'justify-between', default => $titleAlignment, }, ])>
{{ $title }}
@elseif (! $title && $body && $actions)
'justify-start', Alignment::Center => 'justify-center', Alignment::End, Alignment::Right => 'justify-end', Alignment::Between, Alignment::Justify => 'justify-between', default => $bodyAlignment, }, ])> {{ $body }}
@else
'text-start', Alignment::Center => 'text-center', Alignment::End => 'text-end', Alignment::Left => 'text-left', Alignment::Right => 'text-right', Alignment::Justify, Alignment::Between => 'text-justify', default => $titleAlignment, }, ])>
{{ $title }}
'justify-start', Alignment::Center => 'justify-center', Alignment::End, Alignment::Right => 'justify-end', Alignment::Between, Alignment::Justify => 'justify-between', default => $bodyAlignment, }, ])> {{ $body }} @if ($actions) @endif
@endif
@if ($notification->isClosable())
@endif