<div class="block">
    <div class="block-content block-content-full">
        <p class="text-uppercase font-w600 text-center mt-2 mb-4">
            Best Categories
        </p>

        <?php if(isset( $categories )): ?>

                <ul class="nav nav-tabs nav-tabs-block" data-toggle="tabs" role="tablist">

                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parentCategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li class="nav-item <?php if($loop->first): ?> active <?php endif; ?>">
                            <a class="nav-link <?php if($loop->first): ?> active <?php endif; ?>" href="#cat-<?php echo e($parentCategory['id']); ?>"><?php echo e($parentCategory['title']); ?></a>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
                <div class="block-content tab-content">

                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parentCategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="tab-pane <?php if($loop->first): ?> active <?php endif; ?>" id="cat-<?php echo e($parentCategory['id']); ?>" role="tabpanel">

                            <?php if( isset($parentCategory['child_categories'])): ?>
                                <ul class="list-unstyled">
                                    <?php $__currentLoopData = $parentCategory['child_categories']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if( @$category['parent_id'] == @$parentCategory['id']): ?>
                                                <li class="mb-3">
                                                    <a href="#" class="btn btn-block btn-outline-primary btn-sm text-left">
                                                            <i class="<?php echo e((isset($category['icon']) && $category['icon']) ? $category['icon'] : 'fab fa-google-play text-primary'); ?> mr-1"></i>
                                                            <strong><?php echo e($category['title']); ?> </strong>
                                                    </a>
                                                    </li>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            <?php endif; ?>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

            <?php else: ?>
                <div><?php echo e(__('dcm.no_categoriy_configured')); ?></div>
            <?php endif; ?>
    </div>
</div>