@extends('admin.layouts.master')

@section('content')
    <div class="customer-layout">
        <div class="customer-layout-header">
            <div class="flex-align">
                <div class="customer-layout-header-toggle">
                    <i class="las la-bars"></i>
                </div>
                <a href="{{ route('admin.customer.list') }}" class="link">
                    <span class="icon">
                        <i class="fa-solid fa-arrow-left"></i>
                    </span>
                    <span class="text">@lang('Customer List')</span>
                </a>
            </div>

            <div class="customer-layout-header-content">
                <ul class="customer-layout-header-tab">
                    <li class="customer-layout-header-tab-item">
                        <a href="{{ route('admin.customer.overview', $user->id) }}" class="customer-layout-header-tab-link {{ menuActive('admin.customer.overview') }}">
                            <span class="title">@lang('Overview')</span>
                        </a>
                    </li>
                    <li class="customer-layout-header-tab-item">
                        <a href="{{ route('admin.customer.ticket', $user->id) }}" class="customer-layout-header-tab-link {{ menuActive('admin.customer.ticket') }}">
                            <span class="title">@lang('Tickets')</span>
                        </a>
                    </li>
                    <li class="customer-layout-header-tab-item">
                        <a href="{{ route('admin.customer.happiness.rating', $user->id) }}" class="customer-layout-header-tab-link {{ menuActive('admin.customer.happiness.rating') }}">
                            <span class="title">@lang('Happiness Rating')</span>
                        </a>
                    </li>
                    <li class="customer-layout-header-tab-item">
                        <a href="{{ route('admin.customer.attachment', $user->id) }}" class="customer-layout-header-tab-link {{ menuActive('admin.customer.attachment') }}">
                            <span class="title">@lang('Attachments')</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="customer-layout-wrapper">
            <div class="customer-layout-sidebar">
                <div class="customer-layout-sidebar-close">
                    <i class="las la-times"></i>
                </div>
                <div class="customer-layout-sidebar-block">
                    <div class="customer-sidebar-info">
                        <div class="thumb">
                            <img src="{{ getImage(getFilePath('userProfile') . '/' . $user->image, getFileSize('userProfile'), true) }}" alt="customer">
                        </div>
                        <div class="info">
                            <h3 class="name">{{ $user->fullname }}</h3>
                            <p class="desc">@lang('Created'): {{ showDateTime($user->created_at) }}</p>
                        </div>
                        <a href="{{ route('admin.customer.edit', $user->id) }}" class="edit-btn">
                            @include('admin.partials.svg.edit')
                        </a>
                    </div>
                </div>

                <div class="customer-layout-sidebar-block">
                    <p class="title">@lang('Contact Information')</p>
                    <div class="customer-sidebar-contact">
                        <a href="mailto:{{ $user->email }}" class="contact-link">
                            <span class="icon">
                                <i class="fa-solid fa-envelope"></i>
                            </span>
                            <span class="text">{{ $user->email }}</span>
                        </a>

                        @if ($user->mobile)
                            <a href="tel:{{ $user->mobile }}" class="contact-link">
                                <span class="icon">
                                    <i class="fa-solid fa-phone"></i>
                                </span>
                                <span class="text">{{ $user->mobile }}</span>
                            </a>
                        @else
                            <span class="contact-link">
                                <span class="icon">
                                    <i class="fa-solid fa-phone"></i>
                                </span>
                                <span class="text">@lang('Not available')</span>
                            </span>
                        @endif

                    </div>
                </div>
            </div>

            @yield('sub_content')

        </div>
    </div>
@endsection
