@inject ('productViewHelper', 'Webkul\Product\Helpers\View')

@if ($customAttributeValues = $productViewHelper->getAdditionalData($product))
    <div class="upper-section-middle-header-bottom">
        <span class="header-title no-mobile">{{ ucfirst(__('shop::app.products.specification')) }}</span>
        <div class="header-char-section no-mobile">
                @foreach (array_slice($customAttributeValues,0,5) as $attribute)
                <div class="char-wrapper">
                    <span class="char-title">
                        {{ $attribute['label'] ?? $attribute['admin_name']}}
                    </span>
                    <span class="char-value">
                        @if ($attribute['type'] == 'file' && $attribute['value'])
                                <a  href="{{ route('shop.product.file.download', [$product->product_id, $attribute['id']])}}">
                                    <i class="icon sort-down-icon download"></i>
                                </a>
                        @elseif ($attribute['type'] == 'image' && $attribute['value'])
                                <a href="{{ route('shop.product.file.download', [$product->product_id, $attribute['id']])}}">
                                    <img src="{{ Storage::url($attribute['value']) }}" style="height: 20px; width: 20px;" alt=""/>
                                </a>
                        @else
                            {{ $attribute['value'] }}
                        @endif
                    </span>

                </div>
                @endforeach
                <a href="#spesifications" class="header-footer" id="more">{{__('shop::app.products.more-attributes')}}</a>
        </div>
    </div>
@endif
