import React from 'react';
import { Spin } from 'antd';

function Loading({ tip = '加载中...', fullscreen = false }) {
  const style = fullscreen ? {
    position: 'fixed',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    background: 'rgba(255,255,255,0.8)',
    zIndex: 9999
  } : {};

  return (
    <div style={style}>
      <Spin size="large" tip={tip} />
    </div>
  );
}

export default Loading;
