mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
48 lines
924 B
TypeScript
48 lines
924 B
TypeScript
import React from 'react';
|
|
import { Spinner, Flex, Box, SpinnerProps } from '@chakra-ui/react';
|
|
|
|
const Loading = ({
|
|
fixed = true,
|
|
text = '',
|
|
bg = 'rgba(255,255,255,0.5)',
|
|
zIndex = 1000,
|
|
size = 'xl'
|
|
}: {
|
|
fixed?: boolean;
|
|
text?: string;
|
|
bg?: string;
|
|
zIndex?: number;
|
|
size?: SpinnerProps['size'];
|
|
}) => {
|
|
return (
|
|
<Flex
|
|
position={fixed ? 'fixed' : 'absolute'}
|
|
zIndex={zIndex}
|
|
bg={bg}
|
|
borderRadius={'md'}
|
|
top={0}
|
|
left={0}
|
|
right={0}
|
|
bottom={0}
|
|
alignItems={'center'}
|
|
justifyContent={'center'}
|
|
flexDirection={'column'}
|
|
>
|
|
<Spinner
|
|
thickness="4px"
|
|
speed="0.65s"
|
|
emptyColor="myGray.100"
|
|
color="primary.500"
|
|
size={size}
|
|
/>
|
|
{text && (
|
|
<Box mt={2} color="primary.600" fontWeight={'bold'}>
|
|
{text}
|
|
</Box>
|
|
)}
|
|
</Flex>
|
|
);
|
|
};
|
|
|
|
export default Loading;
|