<?php

namespace App\Http\Controllers;

use App\Services\MoodService;
use Illuminate\Http\Request;

class DashboardController extends Controller
{
    protected $moodService;

    public function __construct(MoodService $moodService)
    {
        $this->moodService = $moodService;
    }

    public function index()
    {
        $recentMoods = $this->moodService->getRecentMoods(7);
        $moodStats = $this->moodService->getMoodStats(30);
        $recentChats = auth()->user()->aiConversations()->latest()->take(5)->get();

        return view('dashboard.index', compact('recentMoods', 'moodStats', 'recentChats'));
    }
}
