@php $sort_buttons = [ [ 'label' => __('Date'), 'sort' => 'created_at', ], [ 'label' => __('Title'), 'sort' => 'title', ], [ 'label' => __('Type'), 'sort' => 'openai_id', ], [ 'label' => __('Cost'), 'sort' => 'credits', ], ]; $filter_buttons = [ [ 'label' => __('All'), 'filter' => 'all', ], [ 'label' => __('Favorites'), 'filter' => 'favorites', ], [ 'label' => __('Text'), 'filter' => 'text', ], [ 'label' => __('Image'), 'filter' => 'image', ], [ 'label' => __('Code'), 'filter' => 'code', ], ]; @endphp @extends('panel.layout.app', ['disable_tblr' => true]) @section('title', __('My Documents')) @section('titlebar_title') {{ $currfolder?->name ? __("Folder: $currfolder?->name") : __('My Documents') }} @endsection {{-- Filter list --}} @if ($items && count($items) > 0) @section('titlebar_after')
@if (blank($currfolder))
{{ __('Sort by:') }}
@foreach ($sort_buttons as $button) @endforeach
@foreach ($filter_buttons as $button) $filter == $button['filter'], ]) tag="button" type="submit" name="filter" value="{{ $button['filter'] }}" variant="ghost" ::class="$store.documentsFilter.filter === '{{ $button['filter'] }}' && 'active'" @click="$store.documentsFilter.changeFilter('{{ $button['filter'] }}')" > {{ $button['label'] }} @endforeach
@endif
@endsection @section('titlebar_actions_after')
@endsection @endif @section('content')
{{-- Folders row --}} @if ($currfolder == null) @if (isset(auth()->user()->folders) && count(auth()->user()->folders) > 0)
@foreach (auth()->user()->folders ?? [] as $folder) @endforeach
@endif @else
@endif {{-- Documents row --}} @if (!$items || count($items) === 0) @include('panel.user.openai.documents_empty') @else @include('panel.user.openai.documents_container') @endif
@endsection