@extends('admin.admin_master')

@section('admin')
<div class="page-content">
    <div class="container-fluid">
        <div class="row mb-4">
            <div class="col-12 d-flex justify-content-between align-items-center">
                <h4 class="page-title mb-1">Document Details</h4>
                <a href="{{ url()->previous() }}" class="btn btn-secondary">Back</a>
            </div>
        </div>
        <div class="card mt-4">
            <div class="card-body">
                <h5 class="card-title">{{ $document->title }}</h5>
                <p><strong>Description:</strong> {{ $document->description }}</p>
                <p><strong>Created By:</strong> {{ $document->creator ? $document->creator->name : '-' }}</p>
                <p><strong>Workflow:</strong> {{ $document->workflow ? $document->workflow->name : '-' }}</p>
                <p><strong>Status:</strong> {{ $document->status }}</p>
                <p><strong>Created At:</strong> {{ $document->created_at }}</p>
                @if($document->file_path)
                    <p><strong>File:</strong> <a href="{{ route('workflow.documents.file', $document->id) }}" target="_blank">View / Download</a></p>
                @endif
                @if($document->meta_tags && is_array($document->meta_tags))
                    <p><strong>Meta Tags:</strong></p>
                    <ul>
                        @foreach($document->meta_tags as $key => $value)
                            <li>{{ $key }}: {{ $value }}</li>
                        @endforeach
                    </ul>
                @endif
            </div>
        </div>
    </div>
</div>
@endsection
