import { Alert } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import usePersistedState from '../../../shared/hooks/use-persisted-state' export function LeaversSurveyAlert() { const { t } = useTranslation() const [expirationDate, setExpirationDate] = usePersistedState( 'showInstitutionalLeaversSurveyUntil', 0, true ) const [hide, setHide] = usePersistedState( 'hideInstitutionalLeaversSurvey', false, true ) function handleDismiss() { setExpirationDate(0) setHide(true) } if (Date.now() > expirationDate) { return null } if (hide) { return null } return (

{t('limited_offer')} {`: ${t('institutional_leavers_survey_notification')} `} {t('take_short_survey')}

) }