@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <div>{{ __('إضافة نوع سؤال') }}</div>
                <a class="btn btn-sm btn-secondary" href="{{ route('question-types.index') }}">{{ __('رجوع') }}</a>
            </div>

            <div class="card-body">
                @if ($errors->any())
                    <div class="alert alert-danger">
                        <ul class="mb-0">
                            @foreach ($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif

                <form method="POST" action="{{ route('question-types.store') }}">
                    @csrf

                    <div class="mb-3">
                        <label class="form-label">{{ __('الاسم') }}</label>
                        <input class="form-control" name="name" value="{{ old('name') }}" required>
                    </div>

                    <div class="mb-3">
                        <label class="form-label">{{ __('Slug') }}</label>
                        <input class="form-control" name="slug" value="{{ old('slug') }}" required>
                        <div class="form-text">{{ __('مثال: yes_no أو number أو text') }}</div>
                    </div>

                    <button class="btn btn-primary" type="submit">{{ __('حفظ') }}</button>
                </form>
            </div>
        </div>
    </div>
@endsection

