<template>
  <div class="min-h-screen bg-gray-50">
    <header class="bg-white shadow">
      <div class="max-w-7xl mx-auto py-4 sm:py-6 px-4 sm:px-6 lg:px-8 flex justify-between items-center">
        <h1 class="text-lg sm:text-2xl font-bold text-gray-900 truncate">Fotos - Caso {{ caso.numero_reclamo }}</h1>
        <div class="flex items-center gap-3 sm:gap-4 flex-shrink-0">
          <Link :href="route('portal.casos.ver', caso.id)" class="text-sm sm:text-base text-blue-600 hover:underline whitespace-nowrap">← Volver al Caso</Link>
          <form method="POST" :action="route('portal.logout')">
            <button type="submit" class="text-sm sm:text-base text-gray-600 hover:text-gray-900 whitespace-nowrap">Cerrar Sesión</button>
          </form>
        </div>
      </div>
    </header>

    <main class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
      <div class="bg-white shadow rounded-lg p-4 sm:p-6">
        <div v-if="caso.link_fotos">
          <div class="mb-4 p-4 bg-blue-50 rounded-lg">
            <p class="text-blue-800">
              <strong>Enlace externo:</strong> 
              <a :href="caso.link_fotos" target="_blank" class="underline">{{ caso.link_fotos }}</a>
            </p>
          </div>
          
          <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
            <div class="aspect-square bg-gray-100 rounded-lg flex items-center justify-center">
              <p class="text-gray-500">Ver fotos en enlace externo</p>
            </div>
          </div>
        </div>
        
        <div v-else class="text-center py-12">
          <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
          </svg>
          <p class="mt-4 text-gray-500">No hay fotos disponibles para este caso.</p>
        </div>
      </div>
    </main>
  </div>
</template>

<script setup>
import { Link } from '@inertiajs/vue3'

defineProps({
  title: String,
  caso: Object
})
</script>
