Loading.js 723 B

123456789101112131415161718192021222324
  1. import React from 'react';
  2. import { Spin } from '@douyinfe/semi-ui';
  3. import { useTranslation } from 'react-i18next';
  4. const Loading = ({ prompt: name = '', size = 'large' }) => {
  5. const { t } = useTranslation();
  6. return (
  7. <div className="fixed inset-0 w-screen h-screen flex items-center justify-center bg-white/80 z-[1000]">
  8. <div className="flex flex-col items-center">
  9. <Spin
  10. size={size}
  11. spinning={true}
  12. tip={null}
  13. />
  14. <span className="whitespace-nowrap mt-2 text-center" style={{ color: 'var(--semi-color-primary)' }}>
  15. {name ? t('{{name}}', { name }) : t('加载中...')}
  16. </span>
  17. </div>
  18. </div>
  19. );
  20. };
  21. export default Loading;