<?php

namespace Plainwork\Ui\Renderer\Form;

use Plainwork\Http\Request;
use Plainwork\Ui\Component\Form\FileInput;

final class FileInputRenderer
{
    public function __invoke(FileInput $el, Request $request, callable $next)
    {
        $el = $el
            ->withTag('input')
            ->withAttr('type', 'file')
            // ->withAttr('value', (string) $el->getValue())
            ;

        // if (!$el->getAttr('size')) {
            // $el = $el->withAttr('size', 6);
        // }

        return $next($el, $request);
    }
}
