@extends('admin.layouts.app')

@section('title', __('dashboard.dependent_details'))

@section('content')
<x-admin.page-header title="{{ __('dashboard.dependent_details') }}" :breadcrumbs="[__('dashboard.dependents') => route('admin.dependents.index'), __('dashboard.details') => '']" />

<div class="row justify-content-center">
    <div class="col-xl-12">
        <div class="card bg-primary bg-gradient mb-4">
            <div class="card-body">
                <div class="d-flex align-items-center">
                    <div class="avatar-lg bg-white bg-opacity-25 rounded d-flex align-items-center justify-content-center me-4" style="width: 80px; height: 80px;">
                        <i class="ri-user-line text-white fs-1"></i>
                    </div>
                    <div>
                        <h3 class="mb-1 text-white">{{ $dependent->name }}</h3>
                        <p class="text-white-50 mb-0">{{ \App\Enums\RelationEnum::label($dependent->relation) }} - {{ $dependent->member?->name ?? '-' }}</p>
                    </div>
                    <div class="ms-auto text-end">
                        {!! \App\Enums\MemberStatusEnum::badge($dependent->status) !!}
                    </div>
                </div>
            </div>
        </div>

        <div class="card mb-4">
            <div class="card-header">
                <h5 class="card-title mb-0">{{ __('dashboard.general_info') }}</h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <x-view-col label="{{ __('dashboard.id') }}" :value="$dependent->id"/>
                    <x-view-col label="{{ __('dashboard.name') }}" :value="$dependent->name"/>
                    <x-view-col label="{{ __('dashboard.relationship') }}" :value="\App\Enums\RelationEnum::label($dependent->relation)"/>
                    <x-view-col label="{{ __('dashboard.member') }}" :value="$dependent->member?->name ?? '-'"/>
                    <x-view-col label="{{ __('dashboard.phone') }}" :value="$dependent->phone ?? '-'"/>
                    <x-view-col label="{{ __('dashboard.date_of_birth') }}" :value="$dependent->dob?->format('Y-m-d') ?? '-'"/>
                    <x-view-col label="{{ __('dashboard.created_at') }}" :value="$dependent->created_at"/>
                    <x-view-col label="{{ __('dashboard.updated_at') }}" :value="$dependent->updated_at"/>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
