import {DayPicker} from 'react-day-picker'; import {__} from '@wordpress/i18n'; import Button from '../../../../admin/assets/design/components/Button'; import {format} from 'date-fns'; import 'react-day-picker/dist/style.css'; import './CalendarPopover.scss'; import PreIcon from '../icons/PreIcon'; import BackIcon from '../icons/BackIcon'; const CalendarPopover = ( {currentSelection, onSelect, onApply, month, onMonthChange} ) => { let footer =

Please pick the first day.

; if ( currentSelection?.from ) { if ( !currentSelection.to ) { footer =

{format( currentSelection.from, 'PPP' )}

; } else if ( currentSelection.to ) { footer = (

{format( currentSelection.from, 'PPP' )} – {format( currentSelection.to, 'PPP' )}

); } } return (
{ if ( orientation === 'left' ) { return ; } if ( orientation === 'right' ) { return ; } return null; } }} />
); }; export default CalendarPopover;