@extends('views.layouts.master')
<link rel="stylesheet" href="{{ csset('/themes/pro/modunawa/resources/css/blog-grid.css') }}">
@section('content')

<!--=====================================
BANNER PART START
=======================================-->
<section class="inner-section single-banner">
	<div class="container">
		<h2>이벤트</h2>
		<ol class="breadcrumb">
			<li class="breadcrumb-item"><a href="/">Home</a></li>
			<li class="breadcrumb-item active" aria-current="page"><a href="{{ route('my-page.event.list') }}">이벤트</a></li>
		</ol>
	</div>
</section>
<!--=====================================
BANNER PART END
=======================================-->

<!--=====================================
BLOG GRID PART START
=======================================-->
<section class="inner-section blog-grid">
	<div class="container">
		<div class="row justify-content-center">
			<div class="col-lg-12">
				<div class="row">
					<div class="col-lg-12">
                        @component('views.partial.table-options', [
                        'filterOptions' =>
                            [
                                ['Value' => 'mx.status asc', 'Caption' => '진행 이벤트 순서'],
                                ['Value' => 'mx.status desc', 'Caption' => '종료 이벤트 순서'],
                            ]
                        ])
                        @endcomponent
					</div>
				</div>
				<div class="row row-cols-2 row-cols-md-3 row-cols-lg-3 row-cols-xl-3">
                    @forelse ($eventPage['Page'] ?? [] as $event)
                        <div class="col-md-6 col-lg-6 mb-4">
                            <div class="blog-card">
                                <div class="blog-media">
                                    <a class="blog-img" href="{{ route('my-page.event.show', $event['Id']) }}">
                                        <img class="@if ($event['C8'] === '2') end-event @endif" src="{{ env('MEDIA_URL') . $event['C1'] }}" alt="blog">
                                    </a>
                                </div>
                                <div class="blog-content">
                                    <ul class="blog-meta">
                                        <li>
                                            <i class="fas fa-user"></i>
                                            <span>{{ $event['C9'] }}</span>
                                        </li>
                                        <li>
                                            <i class="fas fa-calendar-alt"></i>
                                            @if (empty($event['C10']))
                                                <span>상시 이벤트</span>
                                            @else
                                                <span>{{ $event['C10'] }} ~ {{ $event['C11'] }}</span>
                                            @endif
                                        </li>
                                        <li>
                                            <i class="icofont-star"></i>
                                            <span>{{ DataConverter::execute($event['C8'], "status('post-event')") }}</span>
                                        </li>
                                    </ul>
                                    <h4 class="blog-title">
                                        <a href="{{ route('my-page.event.show', $event['Id']) }}">{{ $event['C6'] }}</a>
                                    </h4>
                                    <p class="blog-desc">
                                        {{ $event['C7'] }}
                                    </p>
                                    <a class="blog-btn" href="{{ route('my-page.event.show', $event['Id']) }}">
                                        <span>자세히보기</span>
                                        <i class="icofont-arrow-right"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                    @empty
                    @endforelse

				</div>

                <div class="col-lg-12">
                    <div class="bottom-paginate d-flex justify-content-end">
                        {{ $eventPage['Page']->appends(['limit' => request('limit'), 'sort' => request('sort')])->links() }}
                    </div>
                </div>
			</div>

		</div>
	</div>
</section>
<!--=====================================
BLOG GRID PART END
=======================================-->

@endsection
