@extends('layouts.guest.general') @section('main_content') @push('styles') @endpush
{{ __('messages.details') }}
@php $details = [ ['icon' => 'ti-hash', 'label' => __('ID'), 'value' => $machine->sale_ticket_id, 'keep' => true], ['icon' => 'ti-award', 'label' => __('Brand'), 'value' => $machine->brand], ['icon' => 'ti-cpu', 'label' => __('Model'), 'value' => $machine->model], ['icon' => 'ti-calendar-event', 'label' => __('Year'), 'value' => $machine->year], ['icon' => 'ti-settings', 'label' => __('Technology'), 'value' => $machine->type_of_machine ? machine_enum_label($machine->type_of_machine) : null], ]; @endphp
    @foreach ($details as $d) @if (($d['keep'] ?? false) || ! is_placeholder_value($d['value']))
  • {{ $d['label'] }} {{ $d['value'] ?? 'N/A' }}
  • @endif @endforeach

{{ $machineName }}

{!! $machine->description !!}
@if ($machine->secondaryImages->isNotEmpty()) @endif @php // Icono por sección conocida (fallback genérico para extra/custom). $sectionIcon = function ($key) { return [ 'generalInfo' => 'ti-info-circle', 'machineSpecs' => 'ti-settings', 'jacquardDetails' => 'ti-grid-dots', 'loomAccessories' => 'ti-tools', 'beamsAndRollers' => 'ti-cylinder', ][$key] ?? 'ti-list-details'; }; // Normalizamos TODO a tarjetas y descartamos filas placeholder (null, '', '0', '-'). // Una sección solo entra si le queda al menos una fila visible → oculta títulos vacíos. $specCards = []; foreach ($technicalSpecifications as $sectionKey => $sectionData) { $rows = []; foreach ($sectionData as $key => $val) { if (is_array($val) || is_placeholder_value($val)) { continue; } $rows[] = [ 'label' => Lang::has("used_machine.$sectionKey.$key") ? __("used_machine.$sectionKey.$key") : str_replace('_', ' ', $key), 'value' => $val, ]; } if (! empty($rows)) { $specCards[] = [ 'title' => Lang::has("used_machine.sections.$sectionKey") ? __("used_machine.sections.$sectionKey") : str_replace('_', ' ', Str::snake($sectionKey)), 'icon' => $sectionIcon($sectionKey), 'rows' => $rows, ]; } } foreach ($extraFields as $section => $fields) { $rows = []; foreach ($fields as $field) { if (is_placeholder_value($field['value'] ?? null)) { continue; } $rows[] = ['label' => $field['key'] ?? '', 'value' => $field['value']]; } if (! empty($rows)) { $specCards[] = ['title' => str_replace('_', ' ', $section), 'icon' => 'ti-list-details', 'rows' => $rows]; } } foreach ($customSections as $cSec) { $rows = []; foreach ($cSec['fields'] ?? [] as $field) { if (is_placeholder_value($field['value'] ?? null)) { continue; } $rows[] = ['label' => $field['key'] ?? '', 'value' => $field['value']]; } if (! empty($rows)) { $specCards[] = ['title' => $cSec['name'] ?? '', 'icon' => 'ti-list-details', 'rows' => $rows]; } } @endphp @if (! empty($specCards))

{{ __('Technical specifications') }}

@foreach ($specCards as $card)
{{ $card['title'] }}
    @foreach ($card['rows'] as $row)
  • {{ $row['label'] }} @if (is_bool($row['value'])) {{ $row['value'] ? __('Yes') : __('No') }} @else {{ machine_enum_label($row['value']) }} @endif
  • @endforeach
@endforeach
@endif @if ($video) @endif @if (!is_placeholder_value($other['additional_information'] ?? null))

{{ __('Additional information') }}

{!! nl2br(e($other['additional_information'])) !!}

@endif
@livewire('contact-form.catalogue-contact-form', [ 'product_name' => $machineName, 'product_type' => 'Used machine', 'dataDivision' => $division, 'isUsedMachine' => true, 'product_id' => $machine->id, ]) @endsection @push('styles') @endpush @push('scripts') @endpush