@extends('layouts.app')

@section('content')
<div class="row justify-content-center">
    <div class="col-lg-6">
        <div class="card">
            <div class="card-body">
                <h1 class="h4 mb-3">Edit Currency</h1>
                <form method="POST" action="{{ route('currencies.update', $currency) }}">
                    @csrf
                    @method('PUT')
                    <div class="mb-3">
                        <label class="form-label" for="code">Code / Symbol</label>
                        <input class="form-control text-uppercase" id="code" name="code" maxlength="10" value="{{ old('code', $currency->code) }}" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="name">Name</label>
                        <input class="form-control" id="name" name="name" value="{{ old('name', $currency->name) }}" required>
                    </div>
                    <div class="d-flex gap-2">
                        <button class="btn btn-primary" type="submit">Update Currency</button>
                        <a class="btn btn-outline-secondary" href="{{ route('currencies.index') }}">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
