@include('admin.header')

<div class="container py-4">
    <h4 class="mb-3">Edit Term: {{ $term->title }}</h4>

    <form action="{{ route('admin.terms.update', $term->id) }}" method="POST" class="card p-4 shadow-sm">
        @csrf
        @method('PUT')
        <div class="row g-3">
          
            <div class="col-md-6">
                <label class="form-label">Title</label>
                <input type="text" name="title" value="{{ $term->title }}" class="form-control" required>
            </div>
            <div class="col-12">
                <label class="form-label">Content</label>
                <textarea name="content" rows="4" class="form-control">{{ $term->content }}</textarea>
            </div>
       <!--      <div class="col-md-4">
                <label class="form-label">Input Type</label>
                <select name="input_type" class="form-select">
                    <option value="text" {{ $term->input_type == 'text' ? 'selected' : '' }}>Text</option>
                    <option value="textarea" {{ $term->input_type == 'textarea' ? 'selected' : '' }}>Textarea</option>
                    <option value="html" {{ $term->input_type == 'html' ? 'selected' : '' }}>HTML</option>
                </select>
            </div> -->
        <!--     <div class="col-md-4">
                <label class="form-label">Sort Order</label>
                <input type="number" name="sort_order" class="form-control" value="{{ $term->sort_order }}">
            </div>
            <div class="col-md-4">
                <label class="form-label">Visible</label>
                <select name="visible" class="form-select">
                    <option value="1" {{ $term->visible ? 'selected' : '' }}>Yes</option>
                    <option value="0" {{ !$term->visible ? 'selected' : '' }}>No</option>
                </select>
            </div> -->
        </div>
        <div class="mt-4">
            <a href="{{ route('admin.terms.index') }}" class="btn btn-secondary">Back</a>
            <button type="submit" class="btn btn-primary">Update Term</button>
        </div>
    </form>
</div>
@include('admin.footer')
