import { Image } from '@tarojs/components';

import { Dialog } from '@taroify/core';

import './index.less';

interface IProps {
  open: boolean;
  text: string;
}

const PREFIX = 'loading-dialog';

function LoadingDialog(props: IProps) {
  const { open, text } = props;
  return (
    <Dialog className={PREFIX} open={open}>
      <Dialog.Content>
        <div className={`${PREFIX}__dialog-content`}>
          <div className={`${PREFIX}__dialog-content__icon-wrapper`}>
            <div className={`${PREFIX}__dialog-content__icon-bg`} />
            <Image
              mode="aspectFit"
              className={`${PREFIX}__dialog-content__icon`}
              src={require('@/statics/svg/certification-tips-icon.svg')}
            />
          </div>
          <div className={`${PREFIX}__dialog-content__title`}>{text}</div>
        </div>
      </Dialog.Content>
    </Dialog>
  );
}

export default LoadingDialog;
