<x-app-layout>
    <x-slot name="header">
        <h2 class="h4 mb-0">FAQ</h2>
    </x-slot>

    <div class="row g-3">
        <div class="col-md-5">
            <div class="card">
                <div class="card-header">Tambah FAQ</div>
                <div class="card-body">
                    <form action="{{ route('admin-desa.faq.store') }}" method="POST">
                        @csrf
                        <div class="mb-2">
                            <x-text-input name="pertanyaan" placeholder="Pertanyaan" required />
                        </div>
                        <div class="mb-2">
                            <textarea name="jawaban" class="form-control" rows="3" placeholder="Jawaban" required></textarea>
                        </div>
                        <button class="btn btn-primary btn-sm">Tambah</button>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-md-7">
            @foreach ($faqs as $faq)
                <div class="card mb-2">
                    <div class="card-body">
                        <div class="d-flex justify-content-between">
                            <strong>{{ $faq->pertanyaan }}</strong>
                            <form action="{{ route('admin-desa.faq.destroy', $faq) }}" method="POST">
                                @csrf @method('DELETE')
                                <button class="btn btn-sm btn-outline-danger">Hapus</button>
                            </form>
                        </div>
                        <p class="small text-muted mb-0 mt-1">{{ $faq->jawaban }}</p>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
</x-app-layout>
