<? /**
 * @var $block array
 * @var $this  SprintEditorBlocksComponent
 */ ?>
<?
$unicalBlockId=uniqid();
$blockTitle='';
?>
<section class="symptoms-block block light-grey" id="types_<?=$this->includedBlocks;?>">
    <div class="symptoms-block__content container">
        <div class="row">
            <div class="col-12 col-lg-8">
                <?foreach ($block['blocks'] as $key => $blockElem):?>
                    <?switch ($blockElem['name']) {
                        case 'htag':?>
                            <<?=$blockElem['type'];?> class="symptoms-block__title block__title"><?=$blockElem['value'];?></<?=$blockElem['type'];?>>
                            <? $blockTitle=$blockElem['value'];?>
                           <? break;

                        case 'text':?>
                            <div class="symptoms-block__subtitle"><?=$blockElem['value'];?></div>
                            <? $blockTitle=$blockElem['value'];?>
                           <? break;   
                        
                        default:
                            // code...
                            break;
                    }?>
                <?endforeach;?>
            </div>
            <div class="col-12 tabs-container">
                <div class="symptoms-block__tabs tabs">
                    <? foreach ($block['items'] as $itemKey => $item): ?>
                        <button class="tab btn btn_hollow" data-tab-val="<?=$block['name'].'_'.$unicalBlockId.'_'.$itemKey?>"><?= $item['title'] ?></button>
                    <? endforeach; ?>
                </div>
                <div class="symptoms-block__tab-contents tab-contents">
                    <? foreach ($block['items'] as $itemKey => $itemblock): ?>
                        <?

                            $textBlocks=[];
                            $listBlocks=[];
                            $imagesBlocks=[];
                            foreach ($itemblock['blocks'] as $blockInfo){
                                switch ($blockInfo['name']) {
                                    case 'text':
                                       $textBlocks[]=$blockInfo['value'];
                                        break;

                                    case 'lists':
                                       $listBlocks[]=$blockInfo['elements'];
                                        break;

                                    case 'image':
                                        if(!$blockInfo['file']['ID'])continue;
                                        $tempImage=CFile::GetFileArray($blockInfo['file']['ID']);
                                        $tempImage['ALT']=$tempImage['TITLE']=($blockInfo['desc'] ?: $blockTitle);
                                        $imagesBlocks[]=$tempImage;
                                        break;

                                    default:
                                        break;
                                }
                            }
                        ?>
                        <div class="symptoms-block__tab-content tab-content" data-tab-name="<?=$block['name'].'_'.$unicalBlockId.'_'.$itemKey?>">
                            <?if($listBlocks):?>
                                <?foreach ($listBlocks as $listkey => $list):?>
                                <ul class="accent">
                                    <?foreach ($list as $key => $value):?>
                                        <li><?=$value['text'];?></li>
                                    <?endforeach;?>
                                </ul>
                                <?endforeach;?>
                            <?endif;?>
                            <?if($textBlocks):?>
                            <div class="tabs-block__text-container wrap-container">
                                <div class="tabs-block__text wrap-block" data-wrap-height="150">
                                    <?foreach ($textBlocks as $text):?>
                                        <?=$text;?>
                                    <?endforeach;?>
                                </div>
                                <button class="wrap-btn"></button>
                            </div>
                            <?endif;?>
                        </div>
                    <? endforeach; ?>
                </div>
            </div>
        </div>
    </div>
</section>