@extends('layouts.admin')

@section('content')
    <div class="container">
        <div class="card shadow mb-4">
            <div class="card-header py-3 d-flex">
                <h6 class="m-0 font-weight-bold text-primary">
                    Edit review on product : ({{ $review->product->name }})
                </h6>
                <div class="ml-auto">
                    <a href="{{ route('admin.reviews.index') }}" class="btn btn-primary">
                        <span class="icon text-white-50">
                        </span>
                        <span class="text">Back to reviews</span>
                    </a>
                </div>
            </div>
            <div class="card-body">
                <form action="{{ route('admin.reviews.update', $review) }}" method="POST">
                    @csrf
                    @method('PUT')
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group">
                                <label for="status">Status</label>
                                <select name="status" id="status" class="form-control">
                                    <option value="1" {{ old('status', $review->status) == "Active" ? 'selected' : null }}>Active</option>
                                    <option value="0" {{ old('status', $review->status) == "Inactive" ? 'selected' : null }}>Inactive</option>
                                </select>
                                @error('status')<span class="text-danger">{{ $message }}</span>@enderror
                            </div>
                        </div>
                    </div>

                    <div class="form-group pt-4">
                        <button class="btn btn-primary" type="submit" name="submit">Save</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection