@extends('manifest.layout')

@section('title', $doc['title'])

@section('content')
    <div class="doc-head">
        <div class="wrap">
            <a class="back-circle" title="Voltar ao início" href="{{ route('manifest.index') }}">
                <i class="fa-solid fa-arrow-left"></i>
            </a>
            <h1>{{ $doc['title'] }}</h1>
            @if ($doc['date'])
                <div class="date">
                    <i class="fa-regular fa-calendar"></i>
                    {{ \Illuminate\Support\Carbon::parse($doc['date'])->format('d/m/Y H:i') }}
                </div>
            @endif
            <div class="kicker">Release note · registro de bordo · publicado via manifest-it</div>
        </div>
    </div>

    <div class="wrap">
        @if (! empty($doc['journey']))
            <div class="journey">
                <h2>Linha do tempo da task</h2>
                <div class="journey-steps">
                    @foreach ($doc['journey'] as $step)
                        <div class="journey-step {{ $step['done'] ? 'done' : '' }}">
                            <span class="dot"></span>
                            <div class="jlabel">{{ $step['label'] }}</div>
                            <div class="jdate">{{ \Illuminate\Support\Carbon::parse($step['date'])->format('d/m/Y') }}</div>
                        </div>
                    @endforeach
                </div>
            </div>
        @endif

        <article class="doc">
            {!! $doc['html'] !!}
        </article>
    </div>
@endsection
