@extends('admin.preferences._layout')

@section('preferences_content')
<div class="card billing-form-card border-0 shadow-sm">
    <div class="card-header bg-transparent border-bottom d-flex flex-wrap align-items-center gap-2">
        <h5 class="mb-0 fw-semibold flex-grow-1">Edit Tax</h5>
        <form method="POST" action="{{ route('admin.preferences.taxes.destroy', $tax) }}" onsubmit="return confirm('Delete this tax?');">
            @csrf
            @method('DELETE')
            <button type="submit" class="btn btn-outline-danger btn-sm">Delete</button>
        </form>
    </div>
    <div class="card-body">
        <form method="POST" action="{{ route('admin.preferences.taxes.update', $tax) }}">
            @csrf
            @method('PUT')
            @include('admin.preferences.taxes.partials._tax-form', ['tax' => $tax])
            <div class="billing-preferences__footer mt-4 pt-3 border-top">
                <button type="submit" class="btn btn-success px-4">
                    <i class="ri-check-line me-1"></i> Save
                </button>
                <a href="{{ route('admin.preferences.taxes') }}" class="btn btn-light ms-2">Cancel</a>
            </div>
        </form>
    </div>
</div>
@endsection

@stack('scripts')
