@extends('layouts.app') @section('title', 'Fractionals') @section('content')
{{-- Título y botón --}}

Fractionals

Nuevo Fractional
{{-- Mensaje de éxito --}} @if (session('success'))
{{ session('success') }}
@endif {{-- Tabla --}}
@forelse ($fractionals as $fractional) {{-- Imagen --}} {{-- Nombre --}} {{-- Sección --}} {{-- Proyecto (vía section->project) --}} {{-- Estado con badge (igual que Properties) --}} {{-- Acciones --}} @empty @endforelse
Imagen Nombre Sección Proyecto Estado Acciones
@if($fractional->image) {{ $fractional->image->alt ?? $fractional->name }} @else Sin imagen @endif {{ $fractional->name }} {{ optional($fractional->section)->name ?? '—' }} {{ optional(optional($fractional->section)->project)->name ?? '—' }} @php $statusLabels = [ 'available' => ['text' => 'Disponible', 'color' => 'bg-green-100 text-green-800'], 'reserved' => ['text' => 'Reservado', 'color' => 'bg-yellow-100 text-yellow-800'], 'sold' => ['text' => 'Vendido', 'color' => 'bg-red-100 text-red-800'], ]; $st = $statusLabels[$fractional->status] ?? ['text' => ucfirst($fractional->status), 'color' => 'bg-gray-100 text-gray-800']; @endphp {{ $st['text'] }} {{-- Clonar --}}
@csrf
{{-- Ver --}} Ver {{-- Editar --}} Editar {{-- Eliminar --}}
@csrf @method('DELETE')
No hay fractionals registrados.
@endsection