@extends('app')
@section('title', 'Med-X | Dashboard')

@section('content')
    <main class="container-fluid">
        <div class="row">
            <div class="col-sm-3">
                <div class="col-sm-10 pl-0">
                    <a href="/dashboard">
                        <img src="{{env('AUTH_SERVER_URL')}}/public/images/MedX-Logo.png" width="75%" alt="Med-X Logo">
                    </a>
                </div>
            </div>
            <div class="col-sm-6"></div>
            <div class="col-sm-3">
                <div class="user-list mt-0">
                    <div class="name-left border-0 pb-0 pt-1">
                        <h4 class="secondary-color mb-0">{{session('PractitionerName')}}</h4>
                        <small class="primary-color">{{session('suffix')}}</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                @if($httpStatusCode === 403 || (session()->has('features') && count(session()->get('features')) == 0))
                    <div class="restrict-area">
                        <h2>Access Denied – Insufficient Permissions</h2>
                        <p>You don’t have the necessary permissions to access this page or resource.<br>
                        If you believe this is an error, please contact the administrator or support team for assistance.</p>
                    </div>
                @else
                    <div class="row dash-area">
                        @if(session()->has('features') && in_array('SCRIBE', session()->get('features')))
                            <div class="col-sm-3 dash-list"><a href="{{env('APP_URL')}}/scribe"><i class="material-icons-outlined">record_voice_over_outline</i><span>SCRIBE</span></a></div>
                        @endif
                        @if(session()->has('features') && in_array('ADDPATIENT', session()->get('features')))
                            <div class="col-sm-3 dash-list" id="add-patient"><a href="javascript:void(0)"><i class="material-icons-outlined">add_outline</i><span>ADD PATIENT</span></a></div>
                        @endif
                        @if(session()->has('features') && in_array('ELIGIBILITY', session()->get('features')))
                            <div class="col-sm-3 dash-list"><a href="{{env('APP_URL')}}/check-eligibility"><i class="material-icons-outlined">fact_check_outline</i><span>ELIGIBILITY</span></a></div>
                        @endif
                        @if(session()->has('features') && in_array('PREAUTH', session()->get('features')))
                            <div class="col-sm-3 dash-list"><a href="{{env('APP_URL')}}/pre-auth"><i class="material-icons-outlined">security_outline</i><span>PRIOR AUTH</span></a></div>
                        @endif
                        @if(session()->has('features') && in_array('EXPLANATIONOFBENEFIT', session()->get('features')))
                            <div class="col-sm-3 dash-list"><a href="{{env('APP_URL')}}/eob"><i class="material-icons-outlined">shield_outline</i><span>EXPLANATION OF BENEFIT</span></a></div>
                        @endif
                        @if(session()->has('features') && in_array('BENEFITEXPLAINER', session()->get('features')))
                            <div class="col-sm-3 dash-list" id="chatbot-icon"><a href="javascript:void(0)"><i class="material-icons-outlined">chat_outline</i><span>BENEFIT EXPLAINER</span></a></div>
                        @endif
                        <!-- <div class="col-sm-3 dash-list"><a href="javascript:void(0)"><i class="material-icons-outlined">event_available_outline</i><span>APPOINTMENT</span></a></div> -->
                    </div>
                @endif
            </div>
        </div>
    </main>
@endsection