<?php

declare(strict_types=1);



abstract class Widget
{
     
    abstract public function code(): string;

     
    abstract public function name(): string;

     
    abstract public function description(): string;

     
    public function icon(): string
    {
        return 'fa-solid fa-puzzle-piece';
    }

    

    abstract public function render(array $ctx): string;

    

    final protected function partial(string $name, array $data = []): string
    {
        ob_start();
        ThemeRenderer::partial($name, $data);
        return (string) ob_get_clean();
    }
}
