// @flow import React from 'react'; import DateTime from 'component/dateTime'; import { LIVESTREAM_STARTED_RECENTLY_BUFFER } from 'constants/livestream'; import moment from 'moment'; import I18nMessage from 'component/i18nMessage'; type Props = { uri: string, claim: any, activeLivestream: any, }; const LivestreamDateTime = (props: Props) => { const { uri, claim, activeLivestream } = props; if (activeLivestream) { return ( }}> Started %time_date% ); } if ( moment .unix(claim.value.release_time) .isBetween(moment().subtract(LIVESTREAM_STARTED_RECENTLY_BUFFER, 'minutes'), moment()) ) { return __('Starting Soon'); } return ( }}>Live %time_date% ); }; export default LivestreamDateTime;