@extends('admin.template')

@section('content')
    <div class="content-wrapper">
        <div class="row">
            <div class="col-12 grid-margin stretch-card">
                <div class="card">
                    <div class="card-body">
                        <h4 class="card-title">Tanggapi Aduan</h4>
                        <p class="card-description">
                            Form tanggapan admin terhadap aduan masyarakat
                        </p>

                        <form class="forms-sample"
                              action="{{ route('admin.aduan.tanggapi', $aduan->id_aduan) }}"
                              method="POST">
                            @csrf

                            <!-- Nama Pelapor -->
                            <div class="form-group">
                                <label>Nama Pelapor</label>
                                <input type="text" class="form-control"
                                       value="{{ $aduan->nama_pelapor }}"
                                       readonly>
                            </div>

                            <!-- Alamat Pelapor -->
                            <div class="form-group">
                                <label>Alamat Pelapor</label>
                                <input type="text" class="form-control"
                                       value="{{ $aduan->alamat_pelapor }}"
                                       readonly>
                            </div>

                            <!-- Isi Aduan -->
                            <div class="form-group">
                                <label>Isi Aduan</label>
                                <textarea class="form-control" rows="4" readonly>{{ $aduan->isi_aduan }}</textarea>
                            </div>

                            <!-- Bukti Foto -->
                            @if ($aduan->bukti_foto)
                                <div class="form-group">
                                    <label>Bukti Foto</label><br>
                                    <img src="{{ asset('storage/' . $aduan->bukti_foto) }}"
                                         alt="Bukti Aduan"
                                         class="img-fluid rounded"
                                         style="max-height: 250px;">
                                </div>
                            @endif

                            <!-- Tanggapan Admin -->
                            <div class="form-group">
                                <label>Tanggapan Admin</label>
                                <textarea name="tanggapan_admin"
                                          class="form-control"
                                          rows="4"
                                          placeholder="Masukkan tanggapan admin..."
                                          required>{{ old('tanggapan_admin', $aduan->tanggapan_admin) }}</textarea>
                            </div>

                            <!-- Tombol -->
                            <button type="submit" class="btn btn-primary mr-2">
                                Simpan
                            </button>
                            <a href="{{ route('admin.aduan.index') }}" class="btn btn-light">
                                Batal
                            </a>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
