LaiToolManagementSystem/src/pages/TemplateContainer.tsx
2024-10-18 12:46:58 +08:00

40 lines
1.0 KiB
TypeScript

import React, { useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Spin } from 'antd';
import { useSoftStore } from '@/store/software';
interface TemplateContainerProps {
children: React.ReactNode;
navTheme: string;
style?: React.CSSProperties;
title?: React.ReactNode | false;
}
const TemplateContainer: React.FC<TemplateContainerProps> = ({ children, navTheme, style, title }) => {
const { topSpinning, topSpinTip } = useSoftStore();
const backgroundImage =
navTheme === 'realDark'
? 'linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)'
: 'linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)';
return (
<Spin spinning={topSpinning} tip={topSpinTip}>
<PageContainer title={title}>
<Card
style={{
...style,
borderRadius: 8,
}}
>
<div style={{ backgroundImage }}>
{children}
</div>
</Card>
</PageContainer>
</Spin>
);
};
export default TemplateContainer;