. */ namespace SP\Mvc\View\Components; use SP\Domain\Core\Exceptions\FileNotFoundException; use SP\Mvc\View\TemplateInterface; /** * Class DataTab */ final readonly class DataTab { public function __construct(protected string $title, protected TemplateInterface $template) { } public function getTitle(): string { return $this->title; } public function render(): string { try { return $this->template->render(); } catch (FileNotFoundException $e) { return $e->getMessage(); } } }