@extends('layouts.theme1')

@section('title', 'Détails du Banner')

@section('content')
<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="border-bottom title-part-padding d-flex justify-content-between align-items-center">
                <h4 class="card-title mb-0">Détails du banner</h4>
                <div>
                    <a href="{{ route('banners.edit', $banner['id']) }}" class="btn btn-primary">
                        <i class="fas fa-edit"></i> Modifier
                    </a>
                    <a href="{{ route('banners.index') }}" class="btn btn-secondary">
                        <i class="fas fa-arrow-left"></i> Retour
                    </a>
                </div>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-4 text-center mb-4">
                        <img src="{{ $banner['image'] }}" alt="{{ $banner['title'] }}" 
                            class="img-fluid rounded" style="max-height: 200px;">
                    </div>
                    <div class="col-md-8">
                        <table class="table table-bordered">
                            <tr>
                                <th style="width: 200px;">ID Firestore</th>
                                <td>{{ $banner['id'] }}</td>
                            </tr>
                            <tr>
                                <th>Titre</th>
                                <td>{{ $banner['title'] }}</td>
                            </tr>
                            <tr>
                                <th>Description</th>
                                <td>{{ $banner['description'] }}</td>
                            </tr>
                            <tr>
                                <th>Type d'action</th>
                                <td>
                                    <span class="badge bg-info">{{ $banner['actionType'] }}</span>
                                </td>
                            </tr>
                            <tr>
                                <th>Lien d'action</th>
                                <td>
                                    <a href="{{ $banner['actionValue'] }}" target="_blank">
                                        {{ $banner['actionValue'] }}
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <th>Ordre</th>
                                <td>{{ $banner['order'] }}</td>
                            </tr>
                            <tr>
                                <th>Statut</th>
                                <td>
                                    @if($banner['active'] ?? false)
                                        <span class="badge bg-success">Actif</span>
                                    @else
                                        <span class="badge bg-danger">Inactif</span>
                                    @endif
                                </td>
                            </tr>
                            @if(isset($banner['created_at']))
                            <tr>
                                <th>Date de création</th>
                                <td>{{ $banner['created_at'] }}</td>
                            </tr>
                            @endif
                            @if(isset($banner['updated_at']))
                            <tr>
                                <th>Dernière mise à jour</th>
                                <td>{{ $banner['updated_at'] }}</td>
                            </tr>
                            @endif
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection