<?php

declare(strict_types=1);

namespace App\Http\Controllers\Web;

use App\Http\Controllers\Controller;
use App\Support\Seo\SeoFactory;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

final class AccountHelpPageController extends Controller
{
    public function __invoke(Request $request): Response
    {
        $canonical = route('help.account');
        $seo = app(SeoFactory::class)
            ->collectionPage(
                'Account Settings Help — Skinbase',
                'Learn how account settings, profile settings, email changes, password care, and creator preferences work on Skinbase.',
                $canonical,
            )
            ->toArray();

        $seo['og_type'] = 'article';

        return Inertia::render('Help/AccountHelpPage', [
            'title' => 'Account Settings Help',
            'description' => 'Use this guide when account access already works and you need practical help with settings, identity details, email and password care, or ongoing account maintenance.',
            'seo' => $seo,
            'links' => [
                'help_home' => route('help'),
                'help_auth' => route('help.auth'),
                'help_profile' => route('help.profile'),
                'studio_help' => route('help.studio'),
                'upload_help' => route('help.upload'),
                'help_troubleshooting' => route('help.troubleshooting'),
                'profile_settings' => route('dashboard.profile'),
                'open_studio' => route('studio.index'),
                'login' => route('login'),
                'register' => route('register'),
                'password_request' => route('password.request'),
                'contact_support' => route('contact.show'),
                'report_issue' => route('bug-report'),
            ],
            'auth' => [
                'signed_in' => $request->user() !== null,
            ],
        ])->rootView('collections');
    }
}