@php
    $isDraft = $receipt->status === 'draft';
    $isValidated = $receipt->status === 'validated';
@endphp

@can('transition', $receipt)
    @if ($isDraft)
        <form
            method="post"
            action="{{ route('procurement.goods-receipts.validate.store', $receipt) }}"
            class="mb-3"
            data-operational-confirm="{{ __('procurement.receipts.actions.validate') }}"
        >
            @csrf
            <button type="submit" class="btn btn-sm btn-primary w-100">{{ __('procurement.receipts.actions.validate') }}</button>
        </form>
    @endif

    @if ($isValidated)
        <form
            method="post"
            action="{{ route('procurement.goods-receipts.post.store', $receipt) }}"
            data-operational-confirm="{{ __('procurement.receipts.actions.post') }}"
        >
            @csrf
            <input type="hidden" name="idempotency_key" value="{{ $postIdempotencyKey }}">
            <label class="form-label small">{{ __('procurement.receipts.actions.post_confirm') }}</label>
            <input type="text" name="confirmation" class="form-control form-control-sm mb-2" required autocomplete="off">
            <button type="submit" class="btn btn-sm btn-danger w-100">{{ __('procurement.receipts.actions.post') }}</button>
        </form>
    @endif
@endcan
