@extends('vetPortal::layouts.portal')
@section('title', __('vetPortal::lang.my_pets'))

@section('content')
<div class="vp-page-title"><i class="fas fa-paw"></i> {{ __('vetPortal::lang.my_pets') }}</div>

@if($pets->isEmpty())
    <div class="vp-card"><div class="vp-empty">No pets on file. Please contact the clinic.</div></div>
@else
    <div class="vp-grid">
        @foreach($pets as $pet)
            <a href="{{ route('vp.portal.pet', $pet->id) }}" class="vp-pet">
                <div class="nm">{{ $pet->petname }}</div>
                <div class="sub">
                    {{ ucfirst($pet->species ?? 'Pet') }}{{ $pet->breed ? ' · ' . $pet->breed : '' }}
                </div>
                <div class="sub" style="margin-top:4px;">
                    @if($pet->dob)<i class="fas fa-birthday-cake"></i> {{ \Carbon\Carbon::parse($pet->dob)->age }} yr &nbsp;@endif
                    @if($pet->gender)<i class="fas fa-venus-mars"></i> {{ ucfirst($pet->gender) }}@endif
                </div>
                <div style="margin-top:8px;">
                    <span class="vp-badge vp-b-blue">{{ $pet->appointments_count ?? 0 }} visits</span>
                    @if(($pet->status ?? 'active') !== 'active')
                        <span class="vp-badge vp-b-gray">{{ ucfirst($pet->status) }}</span>
                    @endif
                </div>
            </a>
        @endforeach
    </div>
@endif
@endsection
