{% import "helpers/code.html.nunj" as codeMacro %}
{% import "helpers/parameters.html.nunj" as parametersMacro %}
{% import "helpers/no-content.html.nunj" as noContentMacro %}

{% macro render(constructor) %}
    {% set parameters = constructor.getParameters() %}
    <table>
        <tbody>
        <tr>
            <td>
                {% set description = constructor | getJsDocDescription %}

                {{ description if description else noContentMacro.render('No documentation has been provided.') }}
            </td>
        </tr>
        <tr>
            <td>
                <h5 class="no-anchor" indexable="false">Presentation</h5>
                {{ codeMacro.render(constructor | constructorPresentation, "typescript", false) }}
            </td>
        </tr>
        <tr>
            <td>
                {%- if parameters.length %}
                    <h5 class="no-anchor" indexable="false">Parameters</h5>
                    {{ parametersMacro.render(parameters, constructor, true) }}
                {%- endif %}
            </td>
        </tr>
        </tbody>
    </table>
{% endmacro %}
