<div style="overflow-y: scroll; max-height: 500px;">
    @foreach ($target->ticket_reply->sortByDesc('id') as $item)
    @if ($item->sender == 'Admin')
    <div class="alert alert-info text-dark">
        <div class="float-right">
            <b>Admin</b> (Admin)
        </div>
        <br />
        <div class="mb-2 mt-2 text-right"> 
            {!! $item->message !!} 
        </div>
        <div class="float-right" style="margin-top: -10px;">
            <small>
                {{ \Carbon\Carbon::parse($item->created_at)->translatedFormat('d F Y - H:i') }}
                ({{ \Carbon\Carbon::parse($item->created_at)->diffForHumans() }})
            </small>
        </div>
        <br />
    </div>
    @else
    <div class="alert alert-warning text-dark">
        <div class="float-left">
            <b>{{ $item->user->username }}</b> ({{ $item->user->full_name }})
        </div>
        <br />
        <div class="mb-2 mt-2 text-left"> 
            {{ $item->message }} 
        </div>
        <div class="float-left">
            <small>
                {{ \Carbon\Carbon::parse($item->created_at)->translatedFormat('d F Y - H:i') }}
                ({{ \Carbon\Carbon::parse($item->created_at)->diffForHumans() }})
            </small>
        </div>
        <br />
    </div>
    @endif
    @endforeach
    </div>
    @include('admin.layouts.alert-modal') 
    <form method="post" action="{{ request()->url() }}" id="input_form">
        @method('patch')
        @csrf
        <div class="form-group">
            <label>Pesan <text class="text-danger">*</text></label>
            <textarea class="form-control custom-text-editor" name="message" id="message" rows="15">{{ old('message') }}</textarea>
            <small id="message"></small>
        </div>
        <hr />
        <div class="button-items d-grid gap-2 hidden" id="process-button">
            <button type="button" class="btn btn-primary btn-block waves-effect waves-light mt-0" disabled>Mohon Tunggu...</button>
        </div>
        <div class="row" id="main-button">
            <div class="col-6">
                <div class="button-items d-grid gap-2">
                    <button type="reset" class="btn btn-secondary btn-block waves-effect waves-light mt-0"><i class="mdi mdi-refresh"></i> Reset</button>
                </div>
            </div>
            <div class="col-6">
                <div class="button-items d-grid gap-2">
                    <button type="submit" class="btn btn-custom btn-block waves-effect waves-light mt-0"><i class="mdi mdi-send-outline"></i> Submit</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script>
    $('.custom-text-editor').summernote({
        height: 230
    });
</script>
<script src="{{ asset('assets/js/modal-form.js') }}"></script>
<script src="{{ asset('assets/js/app.js') }}"></script>