<x-app-layout>
    <x-slot name="header">
        <h2 class="h4 mb-0">Profil Desa &amp; Lokasi</h2>
    </x-slot>

    <div class="card" style="max-width: 700px;">
        <div class="card-body">
            <form action="{{ route('admin-desa.profil.update') }}" method="POST" enctype="multipart/form-data">
                @csrf @method('PUT')

                <div class="mb-3">
                    <x-input-label for="sambutan" value="Sambutan" />
                    <textarea id="sambutan" name="sambutan" rows="4" class="form-control">{{ old('sambutan', $landingPage->sambutan) }}</textarea>
                    <x-input-error :messages="$errors->get('sambutan')" class="mt-1" />
                </div>

                <div class="mb-3">
                    <x-input-label for="meta_title" value="SEO Title" />
                    <x-text-input id="meta_title" name="meta_title" value="{{ old('meta_title', $landingPage->meta_title) }}" />
                </div>

                <div class="mb-3">
                    <x-input-label for="meta_description" value="SEO Description" />
                    <textarea id="meta_description" name="meta_description" rows="2" class="form-control">{{ old('meta_description', $landingPage->meta_description) }}</textarea>
                </div>

                <div class="mb-3">
                    <x-input-label for="og_image" value="Gambar OG (untuk share sosial media)" />
                    <input type="file" id="og_image" name="og_image" class="form-control" accept="image/*">
                    @if ($landingPage->og_image)
                        <img src="{{ Storage::url($landingPage->og_image) }}" class="mt-2" style="height: 60px;">
                    @endif
                </div>

                <hr>
                <h6>Lokasi &amp; Google Maps</h6>

                <div class="row g-2 mb-3">
                    <div class="col-md-6">
                        <x-input-label for="maps_lat" value="Latitude" />
                        <x-text-input id="maps_lat" name="maps_lat" value="{{ old('maps_lat', $landingPage->maps_lat) }}" />
                        <x-input-error :messages="$errors->get('maps_lat')" class="mt-1" />
                    </div>
                    <div class="col-md-6">
                        <x-input-label for="maps_lng" value="Longitude" />
                        <x-text-input id="maps_lng" name="maps_lng" value="{{ old('maps_lng', $landingPage->maps_lng) }}" />
                        <x-input-error :messages="$errors->get('maps_lng')" class="mt-1" />
                    </div>
                </div>

                <div class="mb-3">
                    <x-input-label for="maps_embed" value="Kode Embed Google Maps (opsional)" />
                    <textarea id="maps_embed" name="maps_embed" rows="3" class="form-control">{{ old('maps_embed', $landingPage->maps_embed) }}</textarea>
                </div>

                <button class="btn btn-primary">Simpan</button>
            </form>
        </div>
    </div>
</x-app-layout>
