<div class="col-md-6">
    <div class="bgc-white bd bdrs-3 p-20 mB-20">
        <h4 class="c-grey-900 mT-10 mB-30">Language Information</h4>

        <!-- Language Name -->
        <div class="mb-3">
            <label for="name">Language name:</label>
            <input type="text" name="name" id="name" class="form-control @error('name') is-invalid @enderror" value="{{ old('name', $language->name ?? '') }}" placeholder="Language name here">
        </div>

        <!-- Locale (only if language is not English) -->
        @if ( !isset($language) || (isset($language) && $language->locale != 'en') )
            <div class="mb-3">
                <label for="locale">Locale:</label>
                <input type="text" name="locale" id="locale" class="form-control @error('locale') is-invalid @enderror" placeholder="i.e. en" value="{{ old('locale', $language->locale ?? '') }}">
                @error('locale')
                <div class="text-danger">{{ $message }}</div>
                @enderror
            </div>
        @endif

        <!-- Direction -->
        <div class="mb-3">
            <label for="direction">Direction:</label>
            <select name="direction" id="direction" class="form-control @error('direction') is-invalid @enderror">
                <option value="ltr" {{ old('direction', $language->direction ?? '') == 'ltr' ? 'selected' : '' }}>Left to Right</option>
                <option value="rtl" {{ old('direction', $language->direction ?? '') == 'rtl' ? 'selected' : '' }}>Right to Left</option>
            </select>
            @error('direction')
            <div class="text-danger">{{ $message }}</div>
            @enderror
        </div>

        <!-- Action Buttons -->
        <div class="mb-3">
            <button type="submit" class="btn btn-primary text-white">Save Language</button>
            @if ( Request::is('*/edit') )
                <a href="{{route('ch-admin.language.index')}}" class="btn btn-default">Cancel</a>
            @endif
        </div>
    </div>
</div>
