<?php

declare(strict_types=1);

namespace PpPhp\Core\Designer\Templates;

use PpPhp\Core\Designer\DesignerTemplate;
use PpPhp\Core\Designer\Presets\DashboardPresetFactory;

class DashboardPageTemplate extends DesignerTemplate
{
    public function toArray(): array
    {
        return $this->basePage(
            'Dashboard',
            DashboardPresetFactory::make($this->presetName())
        );
    }

    private function presetName(): string
    {
        return match ($this->pageType) {
            'dashboard_sales' => 'sales',
            default => 'executive',
        };
    }
}
