<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Badge;
use App\Models\Challenge;
use App\Models\EmotionTag;
use App\Models\HomepageFeature;
use App\Models\LeadMagnet;
use App\Models\MentorStudent;
use App\Models\MistakeTag;
use App\Models\Waitlist;
use Illuminate\View\View;

class GrowthDashboardController extends Controller
{
    public function __invoke(): View
    {
        return view('admin.growth.index', [
            'activeChallenges' => Challenge::where('is_active', true)->count(),
            'activeBadges' => Badge::where('is_active', true)->count(),
            'activeMistakes' => MistakeTag::whereNull('user_id')->where('is_active', true)->count(),
            'activeEmotions' => EmotionTag::where('is_active', true)->count(),
            'homepageFeatures' => HomepageFeature::where('is_active', true)->count(),
            'leadMagnets' => LeadMagnet::where('is_active', true)->count(),
            'waitlistLeads' => Waitlist::count(),
            'mentorStudents' => MentorStudent::where('status', 'active')->count(),
        ]);
    }
}
