@extends('employee.layouts.app')
@section('title', 'Edit Article')
@section('page-title', 'Edit Article')

@push('styles')
<script src="https://cdn.tiny.cloud/1/{{ config('services.tinymce.api_key', 'no-api-key') }}/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
@endpush

@section('content')
<div class="mb-6">
    <h2 class="text-xl font-bold text-gray-800">Edit Blog Article</h2>
    <p class="text-sm text-gray-500 mt-1">Any changes submitted again will go back through admin approval before publishing.</p>
</div>

@if($blogArticle->status === 'rejected' && $blogArticle->review_note)
    <div class="mb-6 rounded-xl border border-red-200 bg-red-50 px-5 py-4">
        <h3 class="text-sm font-bold text-red-700 mb-1">Admin feedback on this rejection</h3>
        <p class="text-sm text-red-600 whitespace-pre-line">{{ $blogArticle->review_note }}</p>
    </div>
@endif

@include('employee.blog-articles._form', [
    'action' => route('employee.blog-articles.update', $blogArticle),
    'method' => 'PUT',
    'blogArticle' => $blogArticle,
    'categories' => $categories,
])
@endsection

@push('scripts')
@include('admin.blog-articles._tinymce')
@endpush
