@extends('layouts.app')

@section('page_title', 'View Locked Account')

@section('content')
    <div class="card">
        <div class="card-header">
            <h5 class="mb-0 fw-bold text-dark">View Locked Account</h5>
        </div>
        <div class="card-body">
            @if (session('error'))
                <div class="alert alert-danger alert-dismissible fade show" role="alert">
                    {{ session('error') }}
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
            @endif
            <div class="mb-3">
                <strong>Card Number:</strong> {{ $member['cardNumber'] }}
            </div>
            <div class="mb-3">
                <strong>First Name:</strong> {{ $member['firstName'] }}
            </div>
            <div class="mb-3">
                <strong>Last Name:</strong> {{ $member['lastName'] }}
            </div>
            <div class="mb-3">
                <strong>Birthday:</strong> {{ $member['birthday'] ? date('F d, Y', strtotime($member['birthday'])) : 'N/A' }}
            </div>
            <div class="mb-3">
                <strong>Card Type:</strong> {{ $member['cardType'] }}
            </div>
            <div class="mb-3">
                <strong>Status:</strong> {{ $member['status'] }}
            </div>
            <div class="d-flex gap-2">
                <a href="{{ route('locked-account') }}" class="btn btn-secondary">Back</a>
                <form action="{{ route('locked-account.activate', $member['id']) }}" method="POST">
                    @csrf
                    <button type="submit" class="btn btn-success" onclick="return confirm('Are you sure you want to activate this account?')">Activate Account</button>
                </form>
            </div>
        </div>
    </div>
@endsection