@extends('admin.layouts.layout')
@section('content')
<div class="row match-height">
    <div class="col-md-12 col-12">
        <div class="card">
            <div class="card-header">
                <h4 class="card-title text-primary">Editando FAQ</h4>
                <p class="text-muted">Editando FAQ no Sistema</p>
                <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button" href="{{ route('faq.index') }}"
                    role="button">Ver todas</a>
            </div>
            <div class="card">
                <div class="card-body">
                    <form action="{{ route('faq.update', $faqs->id) }}" method="POST" class="form-horizontal">
                        @method('PUT')
                        @csrf
                        <div class="box box-info">
                            <div class="row">
                                <div class="form-group col-md-10">
                                    <label class="col-form-label">Título</label>
                                    <input type="text" name="titulo" value="{{ $faqs->titulo }}"
                                        class="form-control @error('titulo') is-invalid @enderror">
                                </div>
                                <div class="form-group col-md-2">
                                    <label class="col-form-label">Covid-19</label>
                                    <select name="covid" class="form-control @error('covid') is-invalid @enderror"
                                        value="{{ old('covid') }}">
                                        <option value="S" @if ($faqs['covid'] == 'S') selected @endif>Sim
                                        </option>
                                        <option value="N" @if ($faqs['covid'] == 'N') selected @endif>Não
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-form-label">Descrição </label>
                                <textarea type="text" class="form-control @error('descricao') is-invalid @enderror" rows="5" name="descricao"
                                    id="editor">{{ $faqs->descricao }}</textarea>
                            </div>
                            <br>
                            <div class="form-group row">
                                <div class="col-sm-12">
                                    <input type="submit" value="Salvar" class="btn btn-sm btn-outline-success w-100">
                                </div>
                            </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
