<?php

/*
 * This file is part of the VITICORE2 package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\LocalizedRouting;

final readonly class LocalizedPageRoutes
{
    /**
     * @param array<string, LocalizedPageRoute> $routes
     */
    public function __construct(
        public string $currentLocale,
        public string $defaultLocale,
        public array $routes,
    ) {
    }

    public function getCurrent(): ?LocalizedPageRoute
    {
        return $this->routes[$this->currentLocale] ?? null;
    }

    public function getDefault(): ?LocalizedPageRoute
    {
        return $this->routes[$this->defaultLocale] ?? null;
    }
}
