@props([
    'panel' => null,
])

@if (is_array($panel))
    @php
        $isWarning = ($panel['banner_tone'] ?? 'primary') === 'warning';
        $containerClass = $isWarning
            ? 'border-warning-200 bg-warning-50/80 dark:border-warning-500/30 dark:bg-warning-500/10'
            : 'border-primary-200 bg-primary-50/80 dark:border-primary-500/30 dark:bg-primary-500/10';
        $primaryColor = $isWarning ? 'warning' : 'primary';
    @endphp

    <div {{ $attributes->class(['flex flex-col gap-4 rounded-xl border p-4 shadow-sm sm:flex-row sm:items-start sm:justify-between', $containerClass]) }}>
        <div class="min-w-0 flex-1 space-y-1">
            <p class="text-base font-semibold text-gray-950 dark:text-white">
                {{ $panel['title'] }}
            </p>
            <p class="text-sm text-gray-600 dark:text-gray-300">
                {{ $panel['banner_description'] }}
            </p>
            <x-dberp.system-update.notice-summary
                :summary="$panel['summary'] ?? null"
                :show-label="false"
                muted
            />
        </div>

        <div class="flex shrink-0 flex-wrap items-center gap-2">
            @isset($actions)
                {{ $actions }}
            @else
                <x-filament::button
                    tag="a"
                    :href="$panel['primary_action_url']"
                    :color="$primaryColor"
                    size="sm"
                >
                    {{ $panel['primary_action_label'] }}
                </x-filament::button>

                @if (filled($panel['secondary_action_url'] ?? null))
                    <x-filament::button
                        tag="a"
                        :href="$panel['secondary_action_url']"
                        color="gray"
                        size="sm"
                    >
                        {{ $panel['secondary_action_label'] }}
                    </x-filament::button>
                @endif
            @endisset
        </div>
    </div>
@endif
