@extends('layouts.app') @section('title', __('app.teacher.agents.manage_title') . ' - ' . config('app.name', 'CurioGPT')) @section('content')

{{ __('app.teacher.agents.agents') }}

{{ __('app.teacher.agents.new_agent') }}
@if (session('success'))
{{ session('success') }}
@endif @if ($agents->isEmpty())

{{ __('app.teacher.agents.no_agents_yet') }}

@else
@foreach ($agents as $agent)
{{-- Image / avatar --}}
@if ($agent->image_path) {{ $agent->name }} @else
{{ strtoupper(mb_substr($agent->name, 0, 1)) }}
@endif

{{ $agent->name }}

{{-- Availability badge --}} @if (!$agent->is_enabled) {{ __('app.common.disabled') }} @elseif ($agent->available_from || $agent->available_until) {{ substr($agent->available_from ?? '??:??', 0, 5) }} – {{ substr($agent->available_until ?? '??:??', 0, 5) }} @else {{ __('app.teacher.agents.always_available') }} @endif
@if ($agent->description)

{{ $agent->description }}

@endif @if (!empty($agent->allowed_groups))

{{ collect($agent->allowed_groups)->map(fn($id) => data_get($groups->get($id), 'name', '#' . $id))->implode(', ') }}

@endif
{{ __('app.common.edit') }}
@csrf
@csrf @method('DELETE')
@endforeach
@endif
{{ __('app.teacher.agents.view_all_student_chats') }}
@endsection