@php
    $editorId = $id ?? ('editor-' . \Illuminate\Support\Str::uuid());
    $editorValue = $value ?? '';
@endphp

@once
    @push('head')
        <link rel="stylesheet" href="https://unpkg.com/trix@2.1.15/dist/trix.css">
    @endpush

    @push('scripts')
        <script src="https://unpkg.com/trix@2.1.15/dist/trix.umd.min.js"></script>
    @endpush
@endonce

<div class="admin-rich-editor">
    <input id="{{ $editorId }}" type="hidden" name="{{ $name }}" value="{{ $editorValue }}">
    <trix-editor input="{{ $editorId }}" class="admin-trix-editor"></trix-editor>

    @if(! empty($hint ?? null))
        <p class="admin-field__hint">{{ $hint }}</p>
    @endif
</div>
