diff --git a/src/views/Community/components/PopularKeywords.js b/src/views/Community/components/PopularKeywords.js index b18625aa..06596c88 100644 --- a/src/views/Community/components/PopularKeywords.js +++ b/src/views/Community/components/PopularKeywords.js @@ -1,6 +1,6 @@ // src/views/Community/components/PopularKeywords.js import React, { useState, useEffect } from 'react'; -import { Tag, Space, Spin, Button } from 'antd'; +import { Tag, Space, Button } from 'antd'; import { useNavigate } from 'react-router-dom'; import { RightOutlined } from '@ant-design/icons'; import { logger } from '../../../utils/logger'; @@ -15,12 +15,10 @@ const DOMAIN_PREFIX = process.env.NODE_ENV === 'production' const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { const [keywords, setKeywords] = useState([]); - const [loading, setLoading] = useState(false); const navigate = useNavigate(); // 加载热门概念(涨幅前20) const loadPopularConcepts = async () => { - setLoading(true); try { const response = await fetch(`${API_BASE_URL}/search`, { method: 'POST', @@ -53,8 +51,6 @@ const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { } catch (error) { logger.error('PopularKeywords', 'loadPopularConcepts', error); setKeywords([]); - } finally { - setLoading(false); } }; @@ -118,7 +114,7 @@ const PopularKeywords = ({ onKeywordClick, keywords: propKeywords }) => { }; return ( - + <> {keywords && keywords.length > 0 && (
{
)} -
+ ); };