{% if domain.status.name == 'pending' %}
    {%  include 'dots_loader.html.twig' %}
{% else %}
    {% if availability.status.image  %}
        <div class="wtotem_table__td">
            <div class="wtotem_table__wrap">
                {% if availability.status.image %}
                    <img src="{{ availability.status.image }}" class="wtotem_table__img"/>
                {% endif %}
            </div>

            <div class="wtotem_table__perfomance wtotem_table__perfomance_long wtotem-ml-20">{{ 'Status'|trans }}: {{ availability.status.text }}</div>
        </div>
    {% endif %}

    <div id="bar-chart" class="bar-chart"></div>

    <div class="wtotem_table__info">
        <h3 class="h3 wtotem_table__subject">{{ 'Presence of the site'|trans }}</h3>
        <div class="wtotem_table__text">
            <img width="18px" height="18px" src="{{ images_path }}{% if domain.is_taken  %}check.svg{% else %}minus.svg {% endif %}" class="svg-icon">
        </div>
    </div>

    {% if domain.redirect_link  %}
        <div class="wtotem_table__info">
            <h3 class="h3 wtotem_table__subject">{{ 'Redirect'|trans }}</h3>
            <div class="wtotem_table__text">{{ domain.redirect_link }}</div>
        </div>
    {% endif %}

    {% if domain.ips  %}
        <div class="wtotem_table__info">
            <h3 class="h3 wtotem_table__subject">{{ 'IP address'|trans }}</h3>
            <div class="wtotem_table__text">
                <select name="ip" aria-label="ip" class="wtotem_select__inner" data-testid="select-ip">
                    {% for item in domain.ips %}
                        <option value="{{ item.ip_address }}">{{ item.ip_address }}, {{ item.country }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
    {% endif %}

    {% if domain.protection  %}
        <div class="wtotem_table__info">
            <h3 class="h3 wtotem_table__subject">{{ 'Site protection'|trans }}</h3>
            <div class="wtotem_table__text">{{ domain.protection }}</div>
        </div>
    {% endif %}


    {% if domain.is_created_at  %}
        <div class="wtotem_table__info">
            <h3 class="h3 wtotem_table__subject">{{ 'Check time'|trans }}</h3>
            <div class="wtotem_table__text">{{ domain.created_at }}</div>
        </div>
    {% endif %}

    <script>
        {% autoescape false %}
        var availability_chart = {{ availability.chart }};
        {% endautoescape %}

        if(typeof drawAvailabilityChart !== 'undefined'){
            if(typeof availability_chart == "object"){
                drawAvailabilityChart(availability_chart);
            }
        }
    </script>

{% endif %}