KTVRemote/resources/views/livewire/pages/search-song.blade.php
allen.yan 55666c1475 202508271300
加入首頁,熱門,最新 頁面
2025-08-27 13:03:26 +08:00

55 lines
2.0 KiB
PHP

<div class="space-y-4 p-4">
{{-- 搜尋框 --}}
<div class="w-full mb-4">
<input
type="text"
wire:model.live.debounce.250ms="search"
placeholder="輸入歌名查詢..."
class="border rounded-lg p-3 w-full focus:ring-2 focus:ring-pink-400 focus:outline-none"
/>
</div>
{{-- 語言篩選 --}}
<div class="flex flex-wrap gap-2 mb-4">
@foreach($languages as $key => $label)
<button
wire:click="selectLanguage('{{ $key }}')"
class="px-4 py-2 rounded-lg border transition
{{ $selectedLanguage === $key ? 'bg-pink-500 text-white border-pink-500' : 'bg-white text-gray-700 border-gray-300' }}">
{{ $label }}
</button>
@endforeach
</div>
{{-- 歌曲列表 Table --}}
<x-table bordered striped size="sm" class="w-full">
<x-slot name="header">
<tr>
<th class="px-4 py-2 w-16 text-center">編號</th>
<th class="px-4 py-2">歌曲</th>
<th class="px-4 py-2 w-24 text-center">操作</th>
</tr>
</x-slot>
@forelse($songs as $song)
<tr wire:click="orderSong({{ $song->id }})" class="hover:bg-gray-50 cursor-pointer">
<td class="px-4 py-2 text-center">{{ $song->id }}</td>
<td class="px-4 py-2">
<div class="flex flex-col">
<span class="text-lg font-semibold">{{ $song->name }}</span>
<span class="text-xs text-gray-500 self-end">{{ $song->str_artists_plus() }}</span>
</div>
</td>
<td class="px-4 py-2 text-blue-500 text-center">點歌</td>
</tr>
@empty
<tr>
<td class="px-4 py-4 text-center text-gray-400" colspan="3">
沒有符合的歌曲
</td>
</tr>
@endforelse
</x-table>
</div>