@extends('layouts.app')

@section('content')
<div class="container">
    <h2>Crear Propiedad</h2>

    <form action="{{ route('properties.store') }}" method="POST" class="form-base ">
        @csrf

        <div class="mb-3">
            <label>Código</label>
            <input type="text" name="code" class="form-control" required>
        </div>

        <div class="mb-3">
            <label>Nombre</label>
            <input type="text" name="name" class="form-control" required>
        </div>

        <!--
        <div class="mb-3">
            <label>Área (m²)</label>
            <input type="number" step="0.01" name="area" class="form-control" required>
        </div>

        <div class="mb-3">
            <label>Precio</label>
            <input type="number" step="0.01" name="price" class="form-control" required>
        </div>
-->

        <div class="mb-3">
            <label>Estado</label>
            <select name="status" class="form-control">
                <option value="available">Disponible</option>
                <option value="reserved">Reservada</option>
                <option value="sold">Vendida</option>
            </select>
        </div>

        <div class="mb-3">
            <label>Fractional</label>
            <select name="fractional_id" class="form-control">
                @foreach($fractionals as $fractional)
                    <option value="{{ $fractional->id }}">{{ $fractional->name }}</option>
                @endforeach
            </select>
        </div>

        <div class="mb-3">
            <label>Tipo de Propiedad</label>
            <select name="property_type_id" class="form-control">
                @foreach($propertyTypes as $type)
                    <option value="{{ $type->id }}">{{ $type->name }}</option>
                @endforeach
            </select>
        </div>

        <button class="btn btn-primary" type="submit">Guardar</button>
    </form>
</div>
@endsection
