@php 
    $modules = App\Utilities\Menu::getModules();
@endphp

@if ($index === 2 && $modules->count() && auth()->check())
    <div class="w-full max-w-6xl mt-8">

        <div class="md:grid grid-cols-3 text-style-white shadow rounded-lg">
            <div class="hidden md:grid place-items-center p-8">
                <img src="images/icon.svg" height="256" width="223" class="max-h-64 relative" alt="Brentwood Crest"/>
            </div>

            <div class="col-span-2 grid place-items-center">
                <div class="body text-block p-8">

                    <h2>Website Management</h2>

                    <table class="">
                        @foreach ($modules as $module)
                            <tr class="">
                                <td>
                                    <p>
                                        <a href="{{ $module['url'] }}" target="{{ array_key_exists('new_window', $module) ? '_blank' : '' }}">
                                            <div class="icon pr-1 inline w-10"><fa-icon icon="{{ $module['icon'] }}"></fa-icon></div>
                                            {{ $module['name'] }}
                                        </a> 
                                        - {{ $module['description'] }}
                                    </p>
                                </td>
                            </tr>
                        @endforeach
                    </table>

                </div>
            </div>

        </div>

    </div>
@endif
