<html
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    data-namespace-typo3-fluid="true"
>

<div class="tab-wrapper">
    <ul class="nav nav-tabs" role="tablist" id="tabs-{id}" data-store-last-tab="{storeLastActiveTab}">
        <f:for each="{items}" as="item" iteration="iteration">
            <f:if condition="{item.content}">
                <li role="presentation" class="nav-item">
                    <button
                        type="button"
                        class="nav-link {f:if(condition: '{iteration.cycle} == {defaultTabIndex}', then: ' active')}"
                        title="{item.linkTitle}"
                        data-typo3-tab="#{id}-{iteration.cycle}"
                        aria-controls="{id}-{iteration.cycle}"
                        role="tab"
                    >
                        <f:if condition="{item.icon}">
                            <f:format.raw>{item.icon}</f:format.raw>
                        </f:if>
                        {item.label}
                        <f:if condition="{item.requiredIcon}">
                            <f:format.raw>{item.requiredIcon}</f:format.raw>
                        </f:if>
                        <f:if condition="{item.stateIcon}">
                            <f:render partial="ModuleTemplate/StateIcon" arguments="{item: item}" />
                        </f:if>
                    </button>
                </li>
            </f:if>
        </f:for>
    </ul>
    <div class="tab-content">
        <f:for each="{items}" as="item" iteration="iteration">
            <f:if condition="{item.content}">
                <div role="tabpanel" class="tab-pane{f:if(condition: '{iteration.cycle} == {defaultTabIndex}', then: ' active')}" id="{id}-{iteration.cycle}">
                    <h2 class="visually-hidden">{item.label}</h2>
                    <f:if condition="{item.description}">
                        <div class="form-section">
                            <p><f:format.nl2br>{item.description}</f:format.nl2br></p>
                        </div>
                    </f:if>
                    <f:if condition="{wrapContent}">
                        <f:then>
                            <div class="form-section">
                                <f:format.raw>{item.content}</f:format.raw>
                            </div>
                        </f:then>
                        <f:else>
                            <f:format.raw>{item.content}</f:format.raw>
                        </f:else>
                    </f:if>
                </div>
            </f:if>
        </f:for>
    </div>
</div>

</html>
