@php
    $waTabs = [
        'whatsapp.dashboard'       => ['Dashboard', 'fa-tachometer-alt'],
        'whatsapp.inbox.index'     => [__('whatsapp::lang.inbox_chat'), 'fa-comments'],
        'whatsapp.channels.index'  => [__('whatsapp::lang.channels'), 'fa-mobile-alt'],
        'whatsapp.templates.index' => [__('whatsapp::lang.templates'), 'fa-file-alt'],
        'whatsapp.workflow.index'  => [__('whatsapp::lang.workflow'), 'fa-project-diagram'],
        'whatsapp.messages.index'  => [__('whatsapp::lang.outbox'), 'fa-paper-plane'],
        'whatsapp.simulator.index' => [__('whatsapp::lang.simulator'), 'fa-vial'],
        'whatsapp.settings.index'  => [__('whatsapp::lang.settings'), 'fa-cog'],
    ];
@endphp
<ul class="nav nav-tabs" style="margin-bottom:15px;">
    @foreach($waTabs as $route => $meta)
        @php $pattern = str_replace('.index', '.*', $route); @endphp
        <li class="{{ request()->routeIs($pattern) || request()->routeIs($route) ? 'active' : '' }}">
            <a href="{{ route($route) }}"><i class="fa {{ $meta[1] }}"></i> {{ $meta[0] }}</a>
        </li>
    @endforeach
</ul>

@if(session('status'))
    <div class="alert alert-{{ session('status')['success'] ? 'success' : 'danger' }} alert-dismissible">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ session('status')['msg'] }}
    </div>
@endif

@if($errors->any())
    <div class="alert alert-danger alert-dismissible">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <ul style="margin:0;padding-left:18px;">
            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
