@extends('layouts.shared') @php $photos = $property->photos ?? collect(); $videos = $property->videos ?? collect(); $primaryPhoto = $photos->firstWhere('is_primary', true) ?? $photos->first(); $otherPhotos = $photos->filter(fn($p) => $p->id !== ($primaryPhoto->id ?? null)); $allPhotos = $photos->values(); $hasVideos = $videos->isNotEmpty(); $propertyTypeLabel = match($property->property_type) { 'casa' => 'Casa', 'apartamento' => 'Apartamento', 'townhouse' => 'Townhouse', 'local' => 'Local Comercial', 'terreno' => 'Terreno', default => $property->property_type, }; $operationLabel = $property->operation_type === 'venta' ? 'Venta' : 'Alquiler'; $operationBadge = $property->operation_type === 'venta' ? '#007bff' : '#28a745'; $statusLabel = match($property->status) { 'disponible' => 'Disponible', 'reservada' => 'Reservada', 'vendida' => 'Vendida', 'alquilada' => 'Alquilada', 'inactiva' => 'Inactiva', default => $property->status, }; $statusBadge = match($property->status) { 'disponible' => '#28a745', 'reservada' => '#ffc107', 'vendida' => '#dc3545', 'alquilada' => '#fd7e14', 'inactiva' => '#6c757d', default => '#6c757d', }; $shareUrl = url('/compartir/' . $property->shared_token); $shareText = $propertyTypeLabel . ' en ' . $property->city . ' - $' . number_format($property->price, 2); $agency = $property->agency; $agent = $property->agent; $agencySocials = []; if ($agency) { $socialFields = ['facebook', 'instagram', 'linkedin', 'twitter', 'youtube', 'tiktok']; foreach ($socialFields as $s) { if ($agency->$s) { $agencySocials[$s] = $agency->$s; } } } @endphp @section('title', $propertyTypeLabel . ' en ' . $property->city) @push('meta') @if($primaryPhoto) @endif @endpush @section('content')
{{-- LIGHTBOX --}} @endsection