@extends('layouts.app')

@section('title', 'AI Management')

@section('content')
<div class="container mx-auto px-4 py-6">
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <!-- AI Configuration Card -->
        <div class="bg-white rounded-lg shadow p-6">
            <h2 class="text-2xl font-bold mb-4">AI Configuration</h2>
            <div class="space-y-4">
                <div>
                    <label class="block text-sm font-medium text-gray-700">Provider</label>
                    <p class="mt-1 text-lg font-semibold">{{ config('lebon.ai.provider') }}</p>
                </div>
                <div>
                    <label class="block text-sm font-medium text-gray-700">Status</label>
                    @if(config('lebon.ai.enabled'))
                        <span class="inline-block mt-1 px-3 py-1 bg-green-100 text-green-800 rounded">✓ Enabled</span>
                    @else
                        <span class="inline-block mt-1 px-3 py-1 bg-red-100 text-red-800 rounded">✗ Disabled</span>
                    @endif
                </div>
            </div>
        </div>

        <!-- Features Card -->
        <div class="bg-white rounded-lg shadow p-6">
            <h2 class="text-2xl font-bold mb-4">AI Features</h2>
            <div class="space-y-2">
                @php
                    $features = config('lebon.ai.features', []);
                @endphp
                @foreach($features as $name => $enabled)
                    <div class="flex items-center justify-between">
                        <span class="text-gray-700">{{ ucfirst(str_replace('_', ' ', $name)) }}</span>
                        @if($enabled)
                            <span class="text-green-600">✓ Active</span>
                        @else
                            <span class="text-gray-400">✗ Inactive</span>
                        @endif
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    <!-- Rate Limiting -->
    <div class="mt-6 bg-white rounded-lg shadow p-6">
        <h2 class="text-2xl font-bold mb-4">Rate Limiting</h2>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-gray-700">Requests per Minute</label>
                <p class="mt-1 text-lg font-semibold">{{ config('lebon.ai.rate_limit.requests_per_minute', 10) }}</p>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700">Requests per Hour</label>
                <p class="mt-1 text-lg font-semibold">{{ config('lebon.ai.rate_limit.requests_per_hour', 100) }}</p>
            </div>
        </div>
    </div>
</div>
@endsection
