<?php

namespace Plainwork\Ui\Renderer;

use Plainwork\Ui\Component\Collection;
use Plainwork\Ui\Component\HtmlElement;

final class CollectionRenderer
{
    public function __invoke(Collection $el)
    {
        $items = $el->getItems();
        if (!$items) {
            return;
        }

        $ret = new HtmlElement('');
        foreach ($items as $item) {
            $ret->append($item);
        }

        return $ret;
    }
}
