@extends('layouts.app')

@section('content')
<div class="container">
    <h1>Renew Membership: {{ $member->first_name }} {{ $member->surname }}</h1>

    <form action="{{ route('payments.renew.store', $member->id) }}" method="POST">
        @csrf

        <div class="grid grid-cols-2 gap-4">
            <div>
                <label>Renew Date</label>
                <input type="date" name="renew_date" value="{{ old('renew_date', now()->format('Y-m-d')) }}" class="border p-2 w-full">
            </div>

            <div>
                <label>Expiry Date</label>
                <input type="date" name="expiry_date" value="{{ old('expiry_date', $member->expiry_date->format('Y-m-d')) }}" class="border p-2 w-full">
            </div>

            <div>
                <label>Amount</label>
                <input type="number" name="amount" value="{{ old('amount', $member->admission_fee) }}" class="border p-2 w-full">
            </div>
        </div>

        <button type="submit" class="mt-4 bg-green-500 text-white px-4 py-2 rounded">Renew Membership</button>
    </form>
</div>
@endsection
