<?php

declare(strict_types=1);

namespace App\Shared\Infrastructure\ApiPlatform\Resource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Shared\Infrastructure\ApiPlatform\State\SidebarProvider;
use Symfony\Component\Serializer\Attribute\Groups;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/sidebar',
            normalizationContext: ['groups' => ['sidebar:read']],
            provider: SidebarProvider::class,
        ),
    ],
)]
final class SidebarResource
{
    /**
     * @var list<array{label:string, icon:string, items: list<array{label:string, to:string, icon:string}>}>
     */
    #[Groups(['sidebar:read'])]
    public array $sections = [];

    /**
     * @var list<string>
     */
    #[Groups(['sidebar:read'])]
    public array $disabledRoutes = [];
}
