update pay ui

This commit is contained in:
2025-12-17 17:45:42 +08:00
parent 697c366e88
commit 542e1c6225
3 changed files with 35 additions and 16 deletions

View File

@@ -106,15 +106,18 @@ const SearchActions = memo<{
onWatchlistToggle,
}) => {
// 股票搜索 Hook
const {
searchResults,
isSearching,
handleSearch: doSearch,
clearSearch,
} = useStockSearch({
const searchHook = useStockSearch({
limit: 10,
debounceMs: 300,
});
onSearch: () => {}, // 空回调,追踪在父组件处理
}) as {
searchResults: StockSearchResult[];
isSearching: boolean;
handleSearch: (query: string) => void;
clearSearch: () => void;
};
const { searchResults, isSearching, handleSearch: doSearch, clearSearch } = searchHook;
// 转换为 AutoComplete options
const stockOptions = useMemo(() => {

View File

@@ -5,7 +5,7 @@
*/
import { lazy } from 'react';
import { Building2, TrendingUp, Wallet, FileBarChart } from 'lucide-react';
import { Building2, Brain, TrendingUp, Wallet, FileBarChart, Newspaper } from 'lucide-react';
import type { CompanyTheme, TabConfig } from './types';
// ============================================
@@ -43,9 +43,11 @@ export const THEME: CompanyTheme = {
// ============================================
const CompanyOverview = lazy(() => import('./components/CompanyOverview'));
const MarketDataView = lazy(() => import('./MarketDataView'));
const DeepAnalysis = lazy(() => import('./components/DeepAnalysis'));
const MarketDataView = lazy(() => import('./components/MarketDataView'));
const FinancialPanorama = lazy(() => import('./components/FinancialPanorama'));
const ForecastReport = lazy(() => import('./ForecastReport'));
const ForecastReport = lazy(() => import('./components/ForecastReport'));
const DynamicTracking = lazy(() => import('./components/DynamicTracking'));
// ============================================
// Tab 配置
@@ -58,6 +60,12 @@ export const TAB_CONFIG: TabConfig[] = [
icon: Building2,
component: CompanyOverview,
},
{
key: 'analysis',
name: '深度分析',
icon: Brain,
component: DeepAnalysis,
},
{
key: 'market',
name: '股票行情',
@@ -76,6 +84,12 @@ export const TAB_CONFIG: TabConfig[] = [
icon: FileBarChart,
component: ForecastReport,
},
{
key: 'tracking',
name: '动态跟踪',
icon: Newspaper,
component: DynamicTracking,
},
];
// ============================================

View File

@@ -83,12 +83,14 @@ const CompanyIndex: React.FC = () => {
} = useCompanyData({ stockCode });
// 事件追踪 Hook
const {
trackStockSearched,
trackTabChanged,
trackWatchlistAdded,
trackWatchlistRemoved,
} = useCompanyEvents({ stockCode });
const companyEvents = useCompanyEvents({ stockCode }) as {
trackStockSearched: (newCode: string, oldCode: string | null) => void;
trackTabChanged: (index: number, name: string, prevIndex: number) => void;
trackWatchlistAdded: (code: string) => void;
trackWatchlistRemoved: (code: string) => void;
};
const { trackStockSearched, trackTabChanged, trackWatchlistAdded, trackWatchlistRemoved } = companyEvents;
// 股票代码变化追踪
useEffect(() => {