mirror of
https://github.com/Funkoala14/CreatorCenter_OOIN.git
synced 2025-06-08 11:59:42 +08:00
27 lines
787 B
React
27 lines
787 B
React
|
import { Spinner } from 'react-bootstrap';
|
||
|
|
||
|
export default function LoadingOverlay({ status }) {
|
||
|
if (status !== 'loading') return null;
|
||
|
return (
|
||
|
<div style={styles.overlay}>
|
||
|
<Spinner animation='border' role='status' variant='primary' style={{ width: '3rem', height: '3rem' }}>
|
||
|
<span className='visually-hidden'>Loading...</span>
|
||
|
</Spinner>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
const styles = {
|
||
|
overlay: {
|
||
|
position: 'absolute', // 可改为 fixed 实现全屏
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
width: '100%',
|
||
|
height: '100%',
|
||
|
backgroundColor: 'rgba(255, 255, 255, 0.6)', // 半透明背景
|
||
|
display: 'flex',
|
||
|
justifyContent: 'center',
|
||
|
alignItems: 'center',
|
||
|
zIndex: 9999,
|
||
|
},
|
||
|
};
|