@props([ 'index', 'name' => '', 'quantity' => '', 'used' => '0', 'productId' => null, 'preserveUsed' => false, 'catalogProducts' => collect(), 'required' => false, ]) @php $catalogNames = $catalogProducts->pluck('name'); $nameInCatalog = $name !== '' && $catalogNames->contains($name); $showLegacyOption = $name !== '' && ! $nameInCatalog && empty($productId); $truncateOptionLabel = static fn (string $value): string => \Illuminate\Support\Str::limit($value, 70); @endphp
@if ($preserveUsed) @endif
Product {{ $index }} @if ($catalogProducts->isEmpty()) @else @endif Product {{ $index }} quantity