@extends('layouts.heading-page')

@section('title')
    News -
@endsection

@section('seo_keywords')
    {{ $dataRow->seo_keyword }}
@endsection

@section('seo_description')
    {{ $dataRow->seo_description }}
@endsection

@section('css')
    <link href="assets/css/page.css" rel="stylesheet"/>
@endsection

@section('breadcrumbs')
    News
@endsection

@section('page-main')
        <!-- 資料內容 -->
        <div class="content-wrap news-wrap">
            <div class="container">
                <h2 class="h2-title">News</h2>
				<section class="news-detail">
					<h3 class="news-detail-title">{{ $dataRow->title }}</h3>
					<div class="news-detail-content img-style video-iframe">
                        @php
                            $img_memo = '';
                            $img_src = '/assets/img/news-item-a01.jpg';
                            $imgs = $dataRow->photos;
                            // $imgs = array_filter($row['photos'], function($v) {
                            //        return $v['is_selected'] == true;
                            //    });
                            if (count($imgs) > 0) 
                            {
                                foreach($imgs as $img)
                                {
                                    //$img_memo = $img['comment'];
                                    $img_src = URL::asset('/storage/'.$img['file_path']);
                                }
                            }
                        @endphp
						<img src="{{ $img_src }}" alt="">
                        {!! $dataRow->body !!}
					</div>
                    @php
                        $items = json_decode($dataRow->source_links, true);
                    @endphp
                    @if (!$items || count($items) < 1)
                    
                    @else
					<div class="news-detail-link">
						<h4><i class="fas fa-link"></i> Source: </h4>
                        @foreach($items as $item)
                            @foreach($item as $key => $value)
                                <div>{{ $key }} <a href="{{ $value }}" target="_blank">{{ $value }}</a></div>
                            @endforeach
                        @endforeach
                        
						
                    @endif

					</div>
				</section>
         		
          		<div class="btn-back"><a href="javascript:history.back()"><i class="fa fa-reply"></i> Return to list page</a></div>
            </div>
        </div>
        
@endsection

@section('script')
    <script type="text/javascript">
		
	</script>
@endsection