<div class="btn-group" role="group">
    <a href="{{ route('qcs.show', $qc->id) }}" class="btn btn-sm btn-info" title="View Details">
        <i class="fas fa-eye"></i>
    </a>

    @if($qc->status === 'pending')
        <a href="{{ route('qcs.create', ['grn' => $qc->grn_id]) }}" class="btn btn-sm btn-primary" title="Start QC Inspection">
            <i class="fas fa-clipboard-check"></i>
        </a>
    @elseif($qc->status === 'in_progress')
        <a href="{{ route('qcs.create', ['grn' => $qc->grn_id]) }}" class="btn btn-sm btn-warning" title="Continue QC Inspection">
            <i class="fas fa-edit"></i>
        </a>
    @elseif($qc->status === 'completed')
        @if(!$qc->stock_added)
            <button class="btn btn-sm btn-success" title="Add to Stock" onclick="addToStock({{ $qc->id }})">
                <i class="fas fa-warehouse"></i>
            </button>
        @endif
        <a href="{{ route('qcs.show', [$qc->id, 'tab' => 'stock']) }}" class="btn btn-sm btn-secondary" title="View Stock Details">
            <i class="fas fa-boxes"></i>
        </a>
    @endif

    @if(in_array($qc->status, ['pending', 'in_progress']))
        <button class="btn btn-sm btn-danger" title="Cancel QC" onclick="cancelQc({{ $qc->id }})">
            <i class="fas fa-times"></i>
        </button>
    @endif
</div>
