@extends('dashboard.route')

@section('route-content')
    <h2>{{ $header }}</h2>
    <ul style="@if($layout === 'horizontal') display: flex; flex-wrap: wrap; @else list-style-type: none; padding: 0; @endif">
        @foreach ($data as $item)
            <li style="margin: 10px; @if($layout === 'horizontal') width: 200px; @endif">
                @if ($avatar)
                    <img src="{{ asset($item['avatar'] ?? '/images/default-avatar.png') }}" alt="Avatar" style="width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;" />
                @endif
                <a href="{{ route('view', $item['id']) }}">{{ $item['first_name'] ?? $item['name'] }}</a>
                <p>{{ strtolower($item['first_name'] ?? $item['name']) }}_{{ strtolower($item['last_name'] ?? '') }}@gmail.com</p>
            </li>
        @endforeach
    </ul>
    <div style="text-align: right;">{{ $footer }}</div>
@endsection