import React from 'react' ; import { useUxUrlParams } from '../../../../context/url_params_context/use_ux_url_params' ; import { useDateRangeRedirect } from '../../../../hooks/use_date_range_redirect' ; import { DatePicker } from '../../../shared/date_picker' ; export function RumDatePicker ( ) { const { urlParams : { rangeFrom , rangeTo , refreshPaused , refreshInterval } , refreshTimeRange , } = useUxUrlParams ( ) ; const { redirect , isDateRangeSet } = useDateRangeRedirect ( ) ; if ( ! isDateRangeSet ) { redirect ( ) ; } return ( < DatePicker rangeFrom = { rangeFrom } rangeTo = { rangeTo } refreshPaused = { refreshPaused } refreshInterval = { refreshInterval } onTimeRangeRefresh = { ( { start , end } ) => { refreshTimeRange ( { rangeFrom : start , rangeTo : end } ) ; } } />); }