@extends('layouts.app')

@section('title', 'Edit Designation')
@section('heading', 'Edit Designation')

@section('content')
    <x-card>
        <form action="{{ route('designations.update', $designation) }}" method="POST" class="space-y-6" novalidate data-name-master-form="edit">
            @csrf
            @method('PUT')
            <div>
                <label class="block text-sm font-medium text-slate-700">Name <span class="text-red-500">*</span></label>
                <input type="text" name="name" value="{{ old('name', $designation->name) }}" class="mt-1 block w-full max-w-md rounded-lg border border-slate-300 px-3 py-2">
                @error('name')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                <p data-js-error="name" class="mt-1 text-sm text-red-600 hidden"></p>
            </div>
            <div class="flex gap-2">
                <x-button type="submit" variant="primary">Update</x-button>
                <a href="{{ route('designations.index') }}" class="inline-flex items-center rounded-lg bg-slate-100 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-200">Cancel</a>
            </div>
        </form>
    </x-card>
@endsection

@push('scripts')
<script src="{{ asset('js/form-validation.js') }}"></script>
<script src="{{ asset('js/form-text-rules.js') }}"></script>
<script src="{{ asset('js/name-master-form-validation.js') }}"></script>
@endpush
