@extends('layouts.site')
@section('meta_title', 'My Profile')
@section('content_header')
@include('partials._components._heading', ['heading' => 'My Profile'])
@endsection
@section('content')
<section class="site-main-section">
    <div class="site-container">
        <div class="account-shell mx-auto max-w-6xl">
            <div class="account-shell__aside min-w-0">
                @include('partials._components._user-menu')
            </div>
            <div class="account-shell__content min-w-0">
                <div class="profile-edit-card mt-4 mb-4">
                    <div class="profile-edit-card__header">
                        <div class="profile-edit-card__intro">
                            <h2 class="profile-edit-card__title">
                                {{ auth()->user()->fullName() }}
                                <span class="fa-regular fa-pen-to-square profile-edit-card__title-icon" aria-hidden="true"></span>
                            </h2>
                            <p class="profile-edit-card__subtitle">View and manage your profile information</p>
                        </div>
                        <div class="profile-edit-card__actions flex-row flex-nowrap items-center">
                            <a href="{{ route('participant.profile.edit') }}" class="btn btn-sm btn-primary edit-profile-button inline-flex items-center justify-center whitespace-nowrap">Edit Profile</a>
                            <a href="{{ route('participant.password.edit') }}" class="btn btn-sm btn-default change-password-button inline-flex items-center justify-center whitespace-nowrap">Change Password</a>
                        </div>
                    </div>
                    <div class="profile-edit-card__body">
                        @yield('content-main')
                        <div class="profile-edit-form-shell">
                            {!! form($form) !!}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
@endsection

@section('js')
@parent
@include('partials._participant.conditionals')
<script type="text/javascript">
    jQuery(function($) {
        $('#profile-form').find('select').each(function () {
            var $select = $(this);

            $select.attr('data-native-select', 'true');

            if ($select.hasClass('select2-hidden-accessible')) {
                $select.select2('destroy');
            }
        });
    });
</script>
@endsection
