import { Box } from '@chakra-ui/react'
import React from 'react'
import Lottie from 'react-lottie'
import { SuccessAnimation } from '../../../constants'

interface ISuccessAnimationComponentProps {}

const SuccessAnimationComponent: React.FunctionComponent<ISuccessAnimationComponentProps> = (props) => {
  const defaultOptions = {
    loop: true,
    autoplay: true,
    animationData: SuccessAnimation,
    rendererSettings: {
      preserveAspectRatio: 'xMidYMid slice',
    },
  }

  return (
    <Box mx="auto" maxW="350px">
      <Lottie options={defaultOptions} isClickToPauseDisabled={true} isStopped={false} isPaused={false} speed={0.8} />
    </Box>
  )
}

export default SuccessAnimationComponent
