@extends('layouts.base')

@section('content')
    <div class="container-fluid">
        <!-- start page title -->
        <div class="d-flex justify-content-between mt-2 mb-2">
            <h2>
                hashtags
            </h2>
            <ol class="breadcrumb m-0">
                {{-- <li class="breadcrumb-item"><a href="{{ route('apps') }}">ระบบจัดการ</a></li> --}}
                {{-- <li class="breadcrumb-item active">ข้อมูลลูกค้า</li> --}}
            </ol>
        </div>
        <!-- end page title -->

        @if ($message = Session::get('success'))
            <div class="alert alert-success">
                <p>{{ $message }}</p>
            </div>
        @endif

        <div class="card">
            <div class="card-body">
                <!-- command bar -->
                {{-- <div class="d-flex justify-content-between">
                    <div>
                        <a class="btn btn-success mb-2" href="{{ route('places.create') }}">
                            <i class="mdi mdi-plus-thick"></i> new hashtag
                        </a>
                    </div>

                </div> --}}
                <!-- end command bar -->
                <table class="table">
                    <thead>
                        <tr class="text-center">
                            {{-- <th>ลำดับ</th> --}}
                            <th>id</th>
                            <th>hashtag</th>
                            <th>hashtag_category_id</th>
                            <th>description</th>

                            {{-- <th>command</th> --}}
                        </tr>
                    </thead>
                    <tbody>
                        @forelse ($hashtags as $index => $hashtag)
                            <tr>
                                <td class="text-center"> {{ $hashtag->id }}
                                </td>
                                <td>{{ $hashtag->hashtag }}</td>
                                <td class="text-center">{{ Str::limit($hashtag->hashtagCategory->category_name, 64) }}</td>
                                <td>{{ Str::limit($hashtag->description, 64) }}</td>

                                {{-- <td class="text-center">
                                    <form action="{{ route('hashtags.destroy', $hashtag->id) }}" method="POST">
                                        <a href="{{ route('hashtags.show', $hashtag->id) }}">Show</a> <br>
                                        <a href="{{ route('hashtags.edit', $hashtag->id) }}">Edit</a>
                                        @csrf
                                        @method('DELETE')
                                        <button type="submit" class="btn btn-danger">Delete</button>
                                    </form>
                                </td> --}}
                            </tr>
                        @empty
                            <tr>
                                <td colspan="14">ไม่มีรายการให้แสดง</td>
                            </tr>
                        @endforelse
                    </tbody>
                </table>
                {{-- <div class="d-flex justify-content-between">

                    <div>
                        {{ $hashtags->links('pagination.paginate') }}
                    </div>
                    <div>
                        หน้าที่ {{ $hashtags->currentPage() }} จาก {{ $hashtags->lastPage() }}
                    </div>
                </div> --}}
            </div>
        </div>
        <!-- end table -->
    </div>
@endsection
