@extends('layouts.main_dashboard.app') @php $isArabic = app()->getLocale() === 'ar'; $items = $inquiries->getCollection(); $answeredCount = $items->filter(fn ($inquiry) => filled($inquiry->teacher_reply))->count(); @endphp @section('title', $isArabic ? 'استفسارات المدرسين' : 'Teacher Inquiries') @section('skip_page_hero', true) @section('content')

{{ $isArabic ? 'تواصل أكاديمي' : 'Academic communication' }}

{{ $isArabic ? 'استفسارات المدرسين' : 'Teacher Inquiries' }}

{{ $isArabic ? 'أرسل استفسارك مباشرة إلى معلم المساق المرتبط بأحد أبنائك، وتابع الردود من شاشة واحدة.' : 'Send an inquiry directly to the teacher of one of your children’s courses and track all replies from one place.' }}

{{ $isArabic ? 'إرسال استفسار جديد' : 'Send New Inquiry' }}

{{ $isArabic ? 'إجمالي الاستفسارات' : 'Total inquiries' }}

{{ $inquiries->total() }}

{{ $isArabic ? 'تم الرد' : 'Answered' }}

{{ $answeredCount }}

{{ $isArabic ? 'الأبناء المرتبطون' : 'Linked children' }}

{{ $children->count() }}

{{ $isArabic ? 'سجل الاستفسارات' : 'Inquiry log' }}

{{ $isArabic ? 'افتح أي استفسار لمراجعة الرسالة والرد المرتبط بها.' : 'Open any inquiry to review the original message and its reply.' }}

@if($items->isEmpty())

{{ $isArabic ? 'لا توجد استفسارات حتى الآن' : 'No inquiries yet' }}

{{ $isArabic ? 'ابدأ بإرسال استفسار مرتبط بأحد مساقات أبنائك.' : 'Start by sending an inquiry about one of your children’s courses.' }}

@else
@foreach($items as $inquiry)

{{ $inquiry->title }}

{{ filled($inquiry->teacher_reply) ? ($isArabic ? 'تم الرد' : 'Answered') : ($isArabic ? 'بانتظار الرد' : 'Awaiting reply') }}
{{ $isArabic ? 'الابن:' : 'Child:' }} {{ $inquiry->student?->name ?? '—' }} {{ $isArabic ? 'المساق:' : 'Course:' }} {{ $inquiry->course?->name ?? '—' }} {{ $isArabic ? 'المعلم:' : 'Teacher:' }} {{ $inquiry->teacher?->name ?? '—' }}

{{ \Illuminate\Support\Str::limit($inquiry->message, 180) }}

{{ __('dashboard.View Inquiry') }}
@endforeach
{{ $inquiries->links('pagination::simple-tailwind') }}
@endif
@endsection