봇 목록 새로고침 버튼 추가
- 헤더에 새로고침 버튼 추가 - 커스텀 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
|
Youtube, Calendar, Clock, CheckCircle, XCircle, RefreshCw, Download
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import Toast from '../../../components/Toast';
|
import Toast from '../../../components/Toast';
|
||||||
|
import Tooltip from '../../../components/Tooltip';
|
||||||
|
|
||||||
function AdminScheduleBots() {
|
function AdminScheduleBots() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -38,6 +39,7 @@ function AdminScheduleBots() {
|
||||||
|
|
||||||
// 봇 목록 조회
|
// 봇 목록 조회
|
||||||
const fetchBots = async () => {
|
const fetchBots = async () => {
|
||||||
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('adminToken');
|
const token = localStorage.getItem('adminToken');
|
||||||
const response = await fetch('/api/admin/bots', {
|
const response = await fetch('/api/admin/bots', {
|
||||||
|
|
@ -265,9 +267,19 @@ function AdminScheduleBots() {
|
||||||
|
|
||||||
{/* 봇 목록 */}
|
{/* 봇 목록 */}
|
||||||
<div className="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
<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>
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="flex justify-center items-center py-20">
|
<div className="flex justify-center items-center py-20">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue