{{-- Deal Explorer — Grid Card Component Props: $property (PropertyData), $userId (nullable int) --}} @props(['property', 'userId' => null]) @php $isFavourited = $userId && $property->favourites->isNotEmpty(); $primaryImage = $property->primaryImage?->image_url; $hasSalePrice = !is_null($property->list_price); $hasRentPrice = !is_null($property->rent_price); $hasFmr = !is_null($property->fair_market_rent); $op = strtolower($property->operation ?? ''); $showSaleStatus = str_contains($op, 'sale'); $showRentStatus = str_contains($op, 'rent'); $isSaleOnly = $op === 'sale' || $op === 'for sale'; $isRentOnly = $op === 'rent' || $op === 'for rent'; $isSaleRent = str_contains($op, 'sale') && str_contains($op, 'rent'); @endphp
{{-- Image --}}
@if ($primaryImage) {{ $property->property_title }} @else
No image available
@endif {{-- Operation badges --}}
@if (str_contains(strtolower($property->operation ?? ''), 'rent')) For Rent @endif @if (str_contains(strtolower($property->operation ?? ''), 'sale')) For Sale @endif
{{-- Favourite button --}}
{{-- Card body --}}
{{-- Title --}}

{{ $property->property_title ?: 'Untitled Property' }}

{{-- Address --}}

{{ implode(', ', array_filter([$property->full_address, $property->city, $property->state, $property->postal_code])) }}

{{-- Stats Card --}}

{{ !is_null($property->bedrooms) ? (int) $property->bedrooms : '-' }}

Beds

{{ !is_null($property->bathrooms) ? (int) $property->bathrooms : '-' }}

Baths

{{ $property->total_area ? number_format($property->total_area) : '-' }}

SQM

{{-- Type + status badges --}}
@if ($property->property_type) {{ $property->property_type }} @endif @if ($showSaleStatus && $property->property_sale_status && $showSaleStatus) Sale Status: {{ $property->property_sale_status }} @endif @if ($showRentStatus && $property->property_rent_status && $showRentStatus) Rent Status: {{ $property->property_rent_status }} @endif
{{-- Prices Card --}}
{{-- Sale Price --}}
Sale Price @if ($isRentOnly) - @elseif ($hasSalePrice) ₹{{ number_format($property->list_price, 2) }} @else - @endif
{{-- Rent Price --}}
Rent Price @if ($isSaleOnly) - @elseif ($hasRentPrice) @php $rentPeriodSymbol = 'M'; if (!empty($property->rent_period)) { $period = strtolower($property->rent_period); if (str_contains($period, 'yearly')) { $rentPeriodSymbol = 'Y'; } elseif (str_contains($period, 'quarterly')) { $rentPeriodSymbol = 'Q'; } } @endphp ₹{{ number_format((float) $property->rent_price, 2) }}/{{ $rentPeriodSymbol }} @else - @endif
{{-- FMR --}} @if ($hasFmr)
FMR ₹{{ number_format($property->fair_market_rent, 2) }}
@endif