@extends('layouts.main_dashboard.app') @php $isArabic = app()->getLocale() === 'ar'; $isAnswered = filled($inquiry->teacher_reply); $studentLabel = $inquiry->student?->name ?? trim(($inquiry->student?->first_name ?? '') . ' ' . ($inquiry->student?->last_name ?? '')) ?: '—'; @endphp @section('title', __('dashboard.View Inquiry') . ' | ' . $inquiry->title) @section('page_heading', $isArabic ? 'تفاصيل الاستفسار' : 'Inquiry Details') @section('page_subtitle', $isArabic ? 'راجع الرسالة الأصلية وأرسل ردك من نفس الشاشة.' : 'Review the original message and send your reply from the same screen.') @section('skip_page_hero', true) @section('content')

{{ $isArabic ? 'استفسارات الطلاب' : 'Student Inquiries' }}

{{ $inquiry->title }}

{{ $isArabic ? 'عرض كامل لرسالة الطالب مع المرفقات والسياق الدراسي، ثم مساحة مباشرة لكتابة الرد.' : 'A complete view of the student message with attachments and course context, followed by a direct reply workspace.' }}

{{ $isArabic ? 'الطالب' : 'Student' }}

{{ $studentLabel }}

{{ $isArabic ? 'المقرر' : 'Course' }}

{{ $inquiry->course?->name ?? '—' }}

{{ $isArabic ? 'الحالة' : 'Status' }}

{{ $isAnswered ? __('dashboard.Replied') : ($isArabic ? 'بانتظار الرد' : 'Awaiting reply') }}

{{ $isArabic ? 'تاريخ الإرسال' : 'Sent at' }}

{{ $inquiry->created_at?->format('Y-m-d') ?? '—' }}

{{ $isArabic ? 'رسالة الطالب' : 'Student message' }}

{{ $inquiry->title }}

{{ $isAnswered ? __('dashboard.Replied') : ($isArabic ? 'جديد' : 'New') }}
{!! nl2br(e($inquiry->message)) !!}
@if($inquiry->studentFiles->isNotEmpty())

{{ __('dashboard.Student Attachments') }}

@foreach($inquiry->studentFiles as $file) {{ $file->file_name }} @endforeach
@endif
@if($isAnswered)

{{ $isArabic ? 'الرد المرسل' : 'Sent reply' }}

{{ __('dashboard.Your Reply') }}

{!! nl2br(e($inquiry->teacher_reply)) !!}
@if($inquiry->teacherFiles->isNotEmpty())

{{ __('dashboard.Your Attachments') }}

@foreach($inquiry->teacherFiles as $file) {{ $file->file_name }} @endforeach
@endif
@else

{{ $isArabic ? 'الرد الآن' : 'Reply now' }}

{{ __('dashboard.Write your reply') }}

@csrf
@endif
@endsection