@csrf


<div class="row">
    <div class="col-sm-6">
        <div class="mb-3">
            <label for="title">Title</label>
            <input class="form-control @error('title') is-invalid @enderror" id="title" type="tetilext"
                value="{{ old('title', $page->title ?? '') }}" name="title" placeholder="tile *">
        </div>
    </div>

    <div class="col-sm-6">
        <div class="mb-3">
            <label for="status">Status</label>
            <select class="form-control @error('status') is-invalid @enderror" id="status" name="status">
                <option value="1" {{ old('status', $page->status ?? '') == 1 ? 'selected' : '' }}>Active</option>
                <option value="0" {{ old('status', $page->status ?? '') == 0 ? 'selected' : '' }}>Inactive</option>
            </select>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-sm-12">
        <div class="mb-3">
            <label for="editor">Description</label>
            <textarea name="content" id="editor" rows="10"
                class="form-control @error('description') is-invalid @enderror">{{ old('description', $page->description ?? '') }}</textarea>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-sm-12">
        <div class="mb-3">
            <label for="meta_description">Meta Description</label>
            <textarea class="form-control @error('meta_description') is-invalid @enderror" id="meta_description"
                name="meta_description"
                placeholder="Meta Description">{{ old('meta_description', $page->meta_description ?? '') }}</textarea>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-sm-12">
        <div class="mb-3">
            <label for="meta_keywords">Meta Keywords</label>
            <input class="form-control @error('meta_keywords') is-invalid @enderror" id="meta_keywords" type="text"
                value="{{ old('meta_keywords', $page->meta_keywords ?? '') }}" name="meta_keywords"
                placeholder="Meta Keywords">
        </div>
    </div>

</div>
{{-- CKEditor --}}
<script src="https://cdn.ckeditor.com/4.21.0/standard/ckeditor.js"></script>
<script>
    CKEDITOR.replace('editor');
</script>

<div class="row">
    <div class="col-sm-12">
        <div class="text-end">
            <button class="btn btn-success me-3" type="submit">{{ isset($page) ? 'Update' : 'Add' }}</button>
            <a class="btn btn-danger" href="{{ route('admin.pages.index') }}">Cancel</a>
        </div>
    </div>
</div>