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

@php
    $html = app(\App\Support\SafeMarkdownHtml::class)->toHtml(is_string($content) ? $content : '');
@endphp

@if ((string) $html !== '')
    <div {{ $attributes->class([
        'dberp-markdown space-y-2 text-sm leading-relaxed text-gray-600 dark:text-gray-400',
        '[&_p]:m-0',
        '[&_ul]:list-disc [&_ul]:space-y-1 [&_ul]:pl-5',
        '[&_ol]:list-decimal [&_ol]:space-y-1 [&_ol]:pl-5',
        '[&_strong]:font-semibold [&_strong]:text-gray-950 dark:[&_strong]:text-white',
        '[&_h1]:text-base [&_h1]:font-semibold [&_h1]:text-gray-950 dark:[&_h1]:text-white',
        '[&_h2]:text-sm [&_h2]:font-semibold [&_h2]:text-gray-950 dark:[&_h2]:text-white',
        '[&_h3]:text-sm [&_h3]:font-semibold [&_h3]:text-gray-950 dark:[&_h3]:text-white',
        '[&_a]:text-primary-600 [&_a]:underline dark:[&_a]:text-primary-400',
        '[&_code]:rounded [&_code]:bg-gray-100 [&_code]:px-1 [&_code]:text-xs dark:[&_code]:bg-white/10',
        '[&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-gray-100 [&_pre]:p-3 dark:[&_pre]:bg-white/10',
        '[&_blockquote]:border-l-2 [&_blockquote]:border-gray-300 [&_blockquote]:pl-3',
    ]) }}>
        {{ $html }}
    </div>
@endif
