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

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

import { PREFIX } from '@/components/product-dialog/const';

interface IProps {
  unlockTime: number;
  onConfirm: () => void;
}

export default function GroupBuySuccess(props: IProps) {
  return (
    <div className={`${PREFIX}__group-buy_success`}>
      <div className={`${PREFIX}__group-buy_success__tips-container`}>
        <Image
          mode="aspectFit"
          className={`${PREFIX}__group-buy_success__icon`}
          src={require('@/statics/svg/success-circle-fill.svg')}
        />
        <div className={`${PREFIX}__group-buy_success__tips`}>购买成功</div>
      </div>
      <div className={`${PREFIX}__group-buy_success__header`}>
        <div>当前剩余人工对接次数</div>
        <div className="highlight">{` ${props.unlockTime}次`}</div>
      </div>
      <Button className={`${PREFIX}__group-buy_success__button`} onClick={props.onConfirm}>
        返回
      </Button>
    </div>
  );
}
