@props([
    'record' => [],
])

<div class="space-y-5">
    <div class="flex items-start gap-4">
        <div class="flex size-12 shrink-0 items-center justify-center rounded-xl bg-primary-50 text-primary-600 dark:bg-primary-400/10 dark:text-primary-400">
            <x-filament::icon icon="heroicon-o-puzzle-piece" class="size-6" />
        </div>

        <div class="min-w-0 space-y-2">
            @if (filled($record['description'] ?? null))
                <p class="text-xs text-gray-500 dark:text-gray-400">
                    {{ __('dberp.plugin_center.catalog.display_description') }}
                </p>
                <x-dberp.markdown :content="$record['description']" />
            @else
                <p class="text-sm leading-relaxed text-gray-600 dark:text-gray-400">
                    {{ __('dberp.plugin_center.catalog.no_description') }}
                </p>
            @endif

            <x-filament::badge :color="$record['state_color'] ?? 'gray'">
                {{ $record['state_label'] ?? '—' }}
            </x-filament::badge>
        </div>
    </div>

    @if (filled($record['install_blocked_reason'] ?? null))
        <x-filament::callout
            color="warning"
            :heading="__('dberp.plugin_center.catalog.install_requirements')"
            :description="$record['install_blocked_reason']"
        />
    @endif

    <dl class="grid gap-3 sm:grid-cols-2">
        <div class="rounded-xl bg-gray-50 px-4 py-3 dark:bg-white/5">
            <dt class="text-xs text-gray-500 dark:text-gray-400">
                {{ __('dberp.plugin_center.catalog.columns.version') }}
            </dt>
            <dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
                {{ $record['latest_version'] ?? __('dberp.plugin_center.installed.version_unknown') }}
            </dd>
        </div>

        <div class="rounded-xl bg-gray-50 px-4 py-3 dark:bg-white/5">
            <dt class="text-xs text-gray-500 dark:text-gray-400">
                {{ __('dberp.plugin_center.installed.columns.identifier') }}
            </dt>
            <dd class="mt-1 break-all font-mono text-sm text-gray-950 dark:text-white">
                {{ $record['plugin_code'] ?? '—' }}
            </dd>
        </div>
    </dl>

    <x-filament::callout
        color="info"
        :heading="__('dberp.plugin_center.catalog.after_install_heading')"
        :description="__('dberp.plugin_center.catalog.after_install_description')"
    />
</div>
