봇 목록 새로고침 버튼 추가
- 헤더에 새로고침 버튼 추가 - 커스텀 Tooltip 컴포넌트 적용 - 로딩 시 아이콘 회전 애니메이션
This commit is contained in:
parent
217746af3e
commit
d3b6598138
1 changed files with 13 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import {
|
|||
Youtube, Calendar, Clock, CheckCircle, XCircle, RefreshCw, Download
|
||||
} from 'lucide-react';
|
||||
import Toast from '../../../components/Toast';
|
||||
import Tooltip from '../../../components/Tooltip';
|
||||
|
||||
function AdminScheduleBots() {
|
||||
const navigate = useNavigate();
|
||||
|
|
@ -38,6 +39,7 @@ function AdminScheduleBots() {
|
|||
|
||||
// 봇 목록 조회
|
||||
const fetchBots = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const token = localStorage.getItem('adminToken');
|
||||
const response = await fetch('/api/admin/bots', {
|
||||
|
|
@ -265,10 +267,20 @@ function AdminScheduleBots() {
|
|||
|
||||
{/* 봇 목록 */}
|
||||
<div className="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div className="px-6 py-4 border-b border-gray-100">
|
||||
<div className="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
|
||||
<h2 className="font-bold text-gray-900">봇 목록</h2>
|
||||
<Tooltip text="새로고침">
|
||||
<button
|
||||
onClick={fetchBots}
|
||||
disabled={loading}
|
||||
className="p-2 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700 disabled:opacity-50"
|
||||
>
|
||||
<RefreshCw size={18} className={loading ? 'animate-spin' : ''} />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
|
||||
{loading ? (
|
||||
<div className="flex justify-center items-center py-20">
|
||||
<div className="animate-spin rounded-full h-10 w-10 border-4 border-primary border-t-transparent"></div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue