@extends('layouts.app')

@section('content')
<div id="recommend" class="container-fluid">
    <div class="row">
        <div class="col text-center">
            <h3>쿠팡 PL</h3>
            <hr/>
        </div>
    </div>

    <div class="row">
        @if(count($recommend['data']) > 0)
            @foreach($recommend['data'] as $row)
                <div class="col-2 col-sm-3 col-md-3 col-lg-2 col-xxl-2">
                    <figure class="figure">
                        <a href="{{ $row['productUrl'] }}" target="_blank">
                            <img src="{{ $row['productImage'] }}" class="figure-img img-fluid rounded" alt="{{ $row['productName'] }}"/>
                        </a>
                        <figcaption class="figure-caption">
                            <a href="{{ $row['productUrl'] }}" target="_blank">{{ $row['productName'] }}</a>
                        </figcaption>
                        <p>{{ number_format($row['productPrice']) }} <small>원</small></p>
                        @if($row['isRocket'])
                        <div class="col-auto">
                            <span class="badge text-bg-info text-light">
                                <i class="bi bi-rocket-takeoff"></i> 로켓배송
                            </span>
                        </div>
                        @endif
                        @if($row['isFreeShipping'])
                        <div class="col-auto">
                            <span class="badge text-bg-warning">
                                <i class="bi bi-truck"></i> 무료배송
                            </span>
                        </div>
                        @endif
                    </figure>
                </div>
            @endforeach
        @else
            <div class="col p-5 text-center">
                조회 결과가 없습니다.
            </div>
        @endif
    </div>
</div>
@endsection
