@php $control = 'mt-1 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500 placeholder:text-xs'; $hasLines = collect($lines)->contains(fn ($row) => trim((string) ($row['description'] ?? '')) !== '' || trim((string) ($row['product_id'] ?? '')) !== ''); @endphp

{{ __('Pick catalogue items, with a quantity and an optional size or variant. The Products note is for anything that is not a line.') }}

@if ($canEdit)
@if (trim($productSearch) !== '') @endif @endif @forelse ($lines as $index => $line)
@if ($canEdit)
@else

{{ $line['description'] ?: __('Untitled line') }} @if (filled($line['variant'] ?? null)) ({{ $line['variant'] }}) @endif

{{ __('Qty :n', ['n' => $line['quantity']]) }} · @if (trim((string) ($line['unit_price'] ?? '')) === '') {{ __('Not estimated') }} @else {{ $currency_code }} {{ number_format((float) $line['unit_price'], 2) }} @endif

@endif
@empty

{{ __('No catalogue lines yet.') }}

@endforelse

@if (! $hasLines) {{ __('Line total: no lines yet') }} @elseif ($lineTotal === null) {{ __('Line total: Not estimated') }} @else {{ __('Line total: :amount', ['amount' => trim($currency_code.' '.number_format($lineTotal, 2))]) }} @endif

@if ($canEdit)
{{ __('Add a line not in the catalogue') }} @if ($showEstimateButton) {{ __('Use the line total as the estimate') }} @endif @if ($showSave) {{ __('Save lines') }} {{ __('Saving…') }} @endif
@endif