<?php

namespace Modules\MainService\Views;

use Modules\MainService\Enums\ViewEnum;
use Modules\MainService\Views\Types\CreateViewRender;
use Modules\MainService\Views\Types\EditViewRender;
use Modules\MainService\Views\Types\FormViewRender;
use Modules\MainService\Views\Types\GridViewRender;
use Modules\MainService\Views\Types\IndexViewRender;
use Modules\MainService\Views\Types\KanbanViewRender;
use Modules\MainService\Views\Types\ListViewRender;
use Modules\MainService\Views\Types\ShowViewRender;

class ViewFactory
{
    public function render(string $viewType = null): RenderInterface
    {
        return match($viewType)
        {
            ViewEnum::KANBAN->value => new KanbanViewRender(),
            ViewEnum::GRID->value => new GridViewRender(),
            ViewEnum::LIST->value => new ListViewRender(),
            ViewEnum::INDEX->value => new IndexViewRender(),
            ViewEnum::CREATE->value => new CreateViewRender(),
            ViewEnum::EDIT->value => new EditViewRender(),
            ViewEnum::SHOW->value => new ShowViewRender(),
            default => new FormViewRender(),
        };
    }
}
