|
5 | 5 | @push('styles') |
6 | 6 | <style> |
7 | 7 | .search-input::placeholder { color: #71717a; } |
| 8 | + .filter-btn.active { background: #6366f1; color: white; } |
8 | 9 | </style> |
9 | 10 | @endpush |
10 | 11 |
|
|
20 | 21 | <!-- Toolbar --> |
21 | 22 | <div class="flex items-center gap-3 mb-6 flex-wrap"> |
22 | 23 | <div class="flex gap-1 bg-[#141419] border border-zinc-800 rounded-md p-1" ref="filter-bar"> |
23 | | - <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-indigo-500 !text-white active" data-status="all">All</button> |
24 | | - <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="waiting">Waiting</button> |
25 | | - <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="active">Active</button> |
26 | | - <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="completed">Completed</button> |
27 | | - <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="failed">Failed</button> |
| 24 | + <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 active" data-status="all">All</button> |
| 25 | + <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="waiting">Waiting</button> |
| 26 | + <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="active">Active</button> |
| 27 | + <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="completed">Completed</button> |
| 28 | + <button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="failed">Failed</button> |
28 | 29 | </div> |
29 | 30 | <div class="relative flex-1 max-w-[280px]"> |
30 | 31 | <svg class="absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500 pointer-events-none" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg> |
|
125 | 126 | useEventListener('click', (e: Event) => { |
126 | 127 | const target = (e.target as HTMLElement).closest('.filter-btn') as HTMLButtonElement | null |
127 | 128 | if (!target) return |
128 | | - const filterBar = useRef('filter-bar') |
129 | | - filterBar.querySelectorAll('.filter-btn').forEach((b: Element) => { |
130 | | - b.classList.remove('active', 'bg-indigo-500', '!text-white') |
131 | | - b.classList.add('bg-transparent') |
132 | | - }) |
133 | | - target.classList.add('active', 'bg-indigo-500', '!text-white') |
134 | | - target.classList.remove('bg-transparent') |
| 129 | + useRef('filter-bar').querySelectorAll('.filter-btn').forEach((b: Element) => b.classList.remove('active')) |
| 130 | + target.classList.add('active') |
135 | 131 | currentStatus = target.dataset.status! |
136 | 132 | filterJobs() |
137 | 133 | }, { target: '[ref="filter-bar"]' }) |
|
0 commit comments