34 lines
814 B
JavaScript
34 lines
814 B
JavaScript
// src/components/Loading/PageLoader.js
|
|
import React from 'react';
|
|
import { Box, Spinner, Text, VStack } from '@chakra-ui/react';
|
|
|
|
/**
|
|
* 页面加载组件 - 用于路由懒加载的 fallback
|
|
* 优雅的加载动画,提升用户体验
|
|
*/
|
|
export default function PageLoader({ message = '加载中...' }) {
|
|
return (
|
|
<Box
|
|
minH="100vh"
|
|
display="flex"
|
|
alignItems="center"
|
|
justifyContent="center"
|
|
bg="gray.50"
|
|
_dark={{ bg: 'gray.900' }}
|
|
>
|
|
<VStack spacing={4}>
|
|
<Spinner
|
|
thickness="4px"
|
|
speed="0.65s"
|
|
emptyColor="gray.200"
|
|
color="blue.500"
|
|
size="xl"
|
|
/>
|
|
<Text fontSize="md" color="gray.600" _dark={{ color: 'gray.400' }}>
|
|
{message}
|
|
</Text>
|
|
</VStack>
|
|
</Box>
|
|
);
|
|
}
|