: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import React, { Fragment, useEffect } from 'react';
import LoadingBlock from '../Common/LoadingBlock';
import MeetingSelector from './MeetingSelector';
import MeetingWarning from './MeetingWarning';
useSelectedMeetingCalendar,
} from './hooks/useMeetings';
import HubspotWrapper from '../Common/HubspotWrapper';
import ErrorHandler from '../Common/ErrorHandler';
import { pluginPath } from '../../constants/leadinConfig';
import { __ } from '@wordpress/i18n';
import Raven from 'raven-js';
interface IMeetingControllerProps {
export default function MeetingController({
}: IMeetingControllerProps) {
mappedMeetings: meetings,
const selectedMeetingOption = useSelectedMeeting(url);
const selectedMeetingCalendar = useSelectedMeetingCalendar(url);
if (!url && meetings.length > 0) {
handleChange(meetings[0].value);
}, [meetings, url, handleChange]);
const handleLocalChange = (option: { value: string }) => {
handleChange(option.value);
const handleConnectCalendar = () => {
Raven.captureMessage('Unable to connect calendar', {
status={(error && error.status) || error}
resetErrorState={() => reload()}
'There was a problem retrieving your meetings',
'Please refresh your meetings or try again in a few minutes',
action: __('Refresh meetings', 'leadin'),
<HubspotWrapper padding="90px 32px 24px" pluginPath={pluginPath}>
{selectedMeetingCalendar && (
status={selectedMeetingCalendar}
onConnectCalendar={handleConnectCalendar}
{meetings.length > 1 && (
onChange={handleLocalChange}
value={selectedMeetingOption}