<?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 StudioHelpPageController extends Controller
{
    public function __invoke(Request $request): Response
    {
        $canonical = route('help.studio');
        $seo = app(SeoFactory::class)
            ->collectionPage(
                'Studio Help — Skinbase',
                'Learn how Studio works on Skinbase, including drafts, publishing, personal versus Group context, artworks, cards, collections, and collaboration workflows.',
                $canonical,
            )
            ->toArray();

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

        return Inertia::render('Help/StudioHelpPage', [
            'title' => 'Studio Help',
            'description' => 'Understand Studio as the creative control center of Skinbase, with guidance for drafts, publishing, artworks, cards, collections, and Group workflows.',
            'seo' => $seo,
            'links' => [
                'help_home' => route('help'),
                'open_studio' => route('studio.index'),
                'studio_content' => route('studio.content'),
                'studio_artworks' => route('studio.artworks'),
                'studio_drafts' => route('studio.drafts'),
                'studio_scheduled' => route('studio.scheduled'),
                'studio_collections' => route('studio.collections'),
                'studio_settings' => route('studio.settings'),
                'studio_cards' => route('studio.cards.index'),
                'create_card' => route('studio.cards.create'),
                'upload' => route('upload'),
                'upload_help' => route('help.upload'),
                'groups_help' => route('help.groups'),
                'groups_quickstart' => route('help.groups.quickstart'),
                'groups_faq' => route('help.groups.faq'),
                'group_studio' => route('studio.groups.index'),
                'help_cards' => route('help.cards'),
                'help_profile' => route('help.profile'),
                'help_auth' => route('help.auth'),
                'contact_support' => route('contact.show'),
                'report_issue' => route('bug-report'),
            ],
            'auth' => [
                'signed_in' => $request->user() !== null,
            ],
        ])->rootView('collections');
    }
}