import React, { useState } from 'react'; import { useHistory } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import { Carousel } from 'react-responsive-carousel'; import Typography from '../../../components/ui/typography/typography'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Button from '../../../components/ui/button'; import { TYPOGRAPHY, FONT_WEIGHT, TEXT_ALIGN, } from '../../../helpers/constants/design-system'; import { DEFAULT_ROUTE } from '../../../helpers/constants/routes'; import { setCompletedOnboarding } from '../../../store/actions'; import OnboardingPinBillboard from './pin-billboard'; export default function OnboardingPinExtension() { const t = useI18nContext(); const [selectedIndex, setSelectedIndex] = useState(0); const history = useHistory(); const dispatch = useDispatch(); const handleClick = async () => { if (selectedIndex === 0) { setSelectedIndex(1); } else { await dispatch(setCompletedOnboarding()); history.push(DEFAULT_ROUTE); } }; return (