<?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 UploadHelpPageController extends Controller
{
    public function __invoke(Request $request): Response
    {
        $canonical = route('help.upload');
        $seo = app(SeoFactory::class)
            ->collectionPage(
                'Upload Help — Skinbase',
                'Learn how uploading works on Skinbase Nova, including draft creation, metadata review, previews, personal versus Group context, contributor credit, publishing, and troubleshooting.',
                $canonical,
            )
            ->toArray();

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

        return Inertia::render('Help/UploadHelpPage', [
            'title' => 'Upload Help',
            'description' => 'Understand the full upload workflow on Skinbase Nova, from file submission and draft creation to metadata review, contributor credit, and final publish.',
            'seo' => $seo,
            'links' => [
                'help_home' => route('help'),
                'upload' => route('upload'),
                'studio_help' => route('help.studio'),
                'open_studio' => route('studio.index'),
                'studio_artworks' => route('studio.artworks'),
                'studio_drafts' => route('studio.drafts'),
                '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'),
                'contact_support' => route('contact.show'),
                'report_issue' => route('bug-report'),
            ],
            'auth' => [
                'signed_in' => $request->user() !== null,
            ],
        ])->rootView('collections');
    }
}