{% import "system/macro/form-component/input.html.twig" as input %}
{% set inputType = 'text' %}

{% if validator.key == 'EMAIL' %}
    {% set inputType = 'email' %}
{% elseif validator.key == 'URL' %}
    {% set inputType = 'url' %}
{% endif %}

{{ input.component({
    errorMessage: translation.errorMessage,
    hint: translation.hint,
    id: id,
    infoMessage: translation.infoMessage,
    isRequired: isRequired,
    name: name,
    type: inputType,
    validationRegex: validator.key == 'VALIDATION_REGEX' ?  validationRegex : null,
    value: value,
}) }}
