- 删除旧的 BasicInfoTab.js (~1000行) - 新建 BasicInfoTab/ 目录,拆分为 10 个 TypeScript 文件: - index.tsx: 主组件(可配置 Tab) - config.ts: Tab 配置 + 黑金主题 - utils.ts: 格式化工具函数 - components/: 5 个面板组件 + LoadingState - 主组件支持 enabledTabs、defaultTabIndex、onTabChange - 应用黑金主题,支持懒加载 (isLazy) - 更新 types.ts 添加 ActualControl、Concentration 等类型字段 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
755 B
TypeScript
33 lines
755 B
TypeScript
// src/views/Company/components/CompanyOverview/BasicInfoTab/components/LoadingState.tsx
|
|
// 复用的加载状态组件
|
|
|
|
import React from "react";
|
|
import { Center, VStack, Spinner, Text } from "@chakra-ui/react";
|
|
import { THEME } from "../config";
|
|
|
|
interface LoadingStateProps {
|
|
message?: string;
|
|
height?: string;
|
|
}
|
|
|
|
/**
|
|
* 加载状态组件(黑金主题)
|
|
*/
|
|
const LoadingState: React.FC<LoadingStateProps> = ({
|
|
message = "加载中...",
|
|
height = "200px",
|
|
}) => {
|
|
return (
|
|
<Center h={height}>
|
|
<VStack>
|
|
<Spinner size="lg" color={THEME.gold} thickness="3px" />
|
|
<Text fontSize="sm" color={THEME.textSecondary}>
|
|
{message}
|
|
</Text>
|
|
</VStack>
|
|
</Center>
|
|
);
|
|
};
|
|
|
|
export default LoadingState;
|