@extends('layouts.app')

@section('title', 'Staff Details')

@section('content')

<div class="row">

    <div class="col-sm-12">
        <div class="card card-transparent card-block card-stretch card-height border-none mb-4">
            <div class="card-body p-0">
                <h3 class="mb-2">Staff Details</h3>
            </div>
        </div>
    </div>


    <div class="col-lg-12">
        <div class="card card-block card-stretch card-height">

            <div class="card-header d-flex justify-content-between">
                <div class="header-title">
                    <h4 class="card-title">Staff Information</h4>
                </div>
            </div>


            <div class="card-body">

                <div class="row">

                    {{-- Staff Name --}}
                    <div class="col-md-6 mb-4">
                        <strong>Staff Name</strong>
                        <p class="mb-0">
                            {{ $staff->user_name }}
                        </p>
                    </div>


                    {{-- Email --}}
                    <div class="col-md-6 mb-4">
                        <strong>Email Address</strong>
                        <p class="mb-0">
                            {{ $staff->user_email }}
                        </p>
                    </div>


                    {{-- Role --}}
                    <div class="col-md-6 mb-4">
                        <strong>Role</strong>
                        <p class="mb-0">
                            {{ $staff->role->role_name ?? 'N/A' }}
                        </p>
                    </div>


                    {{-- Status --}}
                    <div class="col-md-6 mb-4">
                        <strong>Status</strong>

                        <p class="mb-0">

                            @if($staff->is_active)
                                <span class="badge badge-success">
                                    Active
                                </span>
                            @else
                                <span class="badge badge-danger">
                                    Inactive
                                </span>
                            @endif

                        </p>
                    </div>


                    {{-- User ID --}}
                    <div class="col-md-6 mb-4">
                        <strong>Staff ID</strong>
                        <p class="mb-0">
                            {{ $staff->user_id }}
                        </p>
                    </div>


                    {{-- Created At --}}
                    <div class="col-md-6 mb-4">
                        <strong>Created At</strong>
                        <p class="mb-0">
                            {{ $staff->created_at ?? 'N/A' }}
                        </p>
                    </div>

                </div>


                <div class="d-flex flex-wrap mt-4">

                    <a
                        href="{{ route('staff.edit', $staff->user_id) }}"
                        class="btn btn-primary mr-2"
                    >
                        <i class="ri-pencil-line mr-1"></i>
                        Edit Staff
                    </a>

                    <a
                        href="{{ route('staff.list') }}"
                        class="btn btn-outline-secondary"
                    >
                        <i class="ri-arrow-left-line mr-1"></i>
                        Back to Staff List
                    </a>

                </div>

            </div>

        </div>
    </div>

</div>

@endsection