<div>
    <button type="button" wire:click="$emit('loadPage', 'list')" 
    class="btn mx-auto m-3 text-white bg-primary px-3 py-2">Back</button>
<div class="max-w-full mx-auto p-6 bg-gray-100">

<div class="w-full px-6 mb-12 flex justify-center">
    <div class="p-12 bg-white shadow-md rounded-lg w-1/2">
        <h2 class="text-2xl font-bold mb-4">Create Exchangerate</h2>
      
        <div class="mx-auto p-4">
        @if (session()->has('message'))
            <div class="alert alert-success">
                {{ session('message') }}
            </div>
        @endif

        <form wire:submit.prevent="addExchangerate">
           
        <div class="mb-4">
            <label for="currency" class="block text-sm font-medium text-gray-700">Currency</label>
            <input type="text" wire:model.defer="currency" id="currency" class="w-full mt-1 p-2 border border-gray-300 rounded-md">
            @error('currency') <span class="text-red-500">{{ $message }}</span> @enderror
        </div>
        
        <div class="mb-4">
            <label for="exdate" class="block text-gray-700">Expired date</label>
            <input type="date" id="exdate" class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="exdate">
            <!-- @error('exdate') <span class="text-red-500">{{ $message }}</span> @enderror -->
        </div>
        <div class="mb-4">
            <label for="finishdate" class="block text-gray-700">Finish date</label>
            <input type="date" id="finishdate" class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="finishdate">
        </div>

        <div class="mb-4">
            <label for="rate" class="block text-sm font-medium text-gray-700">Rate</label>
            <input type="text" wire:model.defer="rate" id="rate" class="w-full mt-1 p-2 border border-gray-300 rounded-md">
        </div>
        <div class="mb-4">
            <label for="baht" class="block text-sm font-medium text-gray-700">Baht</label>
            <input type="text" wire:model.defer="baht" id="baht" class="w-full mt-1 p-2 border border-gray-300 rounded-md">
        </div>
        <div class="mb-4">
            <label for="exbaht" class="block text-sm font-medium text-gray-700">Export Baht</label>
            <input type="text" wire:model.defer="exbaht" id="exbaht" class="w-full mt-1 p-2 border border-gray-300 rounded-md">
        </div>
            <div class="flex items-center justify-center">
                <button type="submit"
                    class="bg-primary inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                    Save
                </button>
            </div>
        </form>
    </div>

        </div>
    </div>
</div>
