@php
    /** @var string $variant default|failure|completion */
    $variant = $variant ?? 'default';
    $compact = (bool) ($compact ?? false);
    $feedbackUrl = app(\App\Support\DberpOfficialFeedback::class)->url();

    $hint = match ($variant) {
        'failure' => __('dberp.feedback.install.failure_hint'),
        'completion' => __('dberp.feedback.install.completion_hint'),
        default => __('dberp.feedback.install.hint'),
    };

    $linkLabel = $variant === 'failure'
        ? __('dberp.feedback.install.submit_install_issue')
        : __('dberp.feedback.install.submit');
@endphp

<div @class([
    'install-official-feedback',
    'install-official-feedback--compact' => $compact,
    'install-official-feedback--failure' => $variant === 'failure',
])>
    <p class="install-official-feedback__hint">{{ $hint }}</p>
    <a
        class="install-official-feedback__link"
        href="{{ $feedbackUrl }}"
        target="_blank"
        rel="noopener noreferrer"
    >{{ $linkLabel }}</a>
</div>

@once
    <style>
        .install-official-feedback {
            margin-top: 1.25rem;
            padding: .875rem 1rem;
            border-radius: .625rem;
            border: 1px solid var(--s200, #e2e8f0);
            background: var(--s50, #f8fafc);
            font-size: .875rem;
            color: var(--s600, #475569);
            line-height: 1.55;
        }
        .install-official-feedback--compact {
            margin-top: 1rem;
            padding: .75rem .875rem;
            font-size: .8125rem;
        }
        .install-official-feedback--failure {
            background: #fffbeb;
            border-color: #fde68a;
            color: #92400e;
        }
        .install-official-feedback__hint {
            margin: 0 0 .5rem;
        }
        .install-official-feedback__link {
            display: inline-flex;
            align-items: center;
            font-weight: 600;
            color: #2563eb;
            text-decoration: none;
        }
        .install-official-feedback__link:hover {
            text-decoration: underline;
        }
        .install-official-feedback--failure .install-official-feedback__link {
            color: #1d4ed8;
        }
    </style>
@endonce
