<?php

namespace App\Http\Controllers;

use App\Support\UserInvestmentPortfolio;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

class DashboardController extends Controller
{
    /**
     * Render the authenticated user's dashboard with investment summaries.
     */
    public function __invoke(Request $request): Response
    {
        /** @var \App\Models\User $user */
        $user = $request->user();

        return Inertia::render(
            'dashboard',
            UserInvestmentPortfolio::summaryForDashboard($user),
        );
    }
}
