2023-07-25 09:31:44 +08:00
|
|
|
import type { FC } from 'react';
|
|
|
|
import React, { Suspense } from 'react';
|
|
|
|
import { createStyles } from 'antd-style';
|
2023-07-28 16:17:43 +08:00
|
|
|
import { Skeleton } from 'antd';
|
2023-07-25 09:31:44 +08:00
|
|
|
import type { BehaviorMapProps } from './BehaviorMap';
|
2023-02-20 10:51:18 +08:00
|
|
|
|
2023-07-25 09:31:44 +08:00
|
|
|
const InternalBehaviorMap = React.lazy(() => import('./BehaviorMap'));
|
2023-02-20 10:51:18 +08:00
|
|
|
|
2023-07-25 09:31:44 +08:00
|
|
|
const useStyle = createStyles(({ token, css }) => ({
|
|
|
|
fallback: css`
|
2023-02-20 10:51:18 +08:00
|
|
|
width: 100%;
|
2023-07-25 09:31:44 +08:00
|
|
|
> * {
|
2024-01-19 14:47:04 +08:00
|
|
|
width: 100% !important;
|
2023-07-25 09:31:44 +08:00
|
|
|
border-radius: 8px;
|
2023-02-20 10:51:18 +08:00
|
|
|
}
|
|
|
|
`,
|
2023-07-25 09:31:44 +08:00
|
|
|
placeholder: css`
|
|
|
|
color: ${token.colorTextDescription};
|
|
|
|
font-size: 16px;
|
2023-02-20 10:51:18 +08:00
|
|
|
`,
|
|
|
|
}));
|
|
|
|
|
2023-07-25 09:31:44 +08:00
|
|
|
const BehaviorMapFallback = () => {
|
2023-02-20 10:51:18 +08:00
|
|
|
const { styles } = useStyle();
|
|
|
|
|
|
|
|
return (
|
2023-07-25 09:31:44 +08:00
|
|
|
<div className={styles.fallback}>
|
|
|
|
<Skeleton.Node active style={{ height: 600, width: '100%' }}>
|
|
|
|
<span className={styles.placeholder}>正在载入行为模式地图...</span>
|
|
|
|
</Skeleton.Node>
|
2023-02-20 10:51:18 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-07-25 09:31:44 +08:00
|
|
|
const BehaviorMap: FC<BehaviorMapProps> = (props) => (
|
|
|
|
<Suspense fallback={<BehaviorMapFallback />}>
|
|
|
|
<InternalBehaviorMap {...props} />
|
|
|
|
</Suspense>
|
|
|
|
);
|
|
|
|
|
2023-02-20 10:51:18 +08:00
|
|
|
export default BehaviorMap;
|