| 1 |
import React, { Fragment } from 'react'; |
| 2 |
import { CURRENT_USER_CALENDAR_MISSING } from '../../shared/Meeting/constants'; |
| 3 |
import ElementorButton from '../Common/ElementorButton'; |
| 4 |
import ElementorBanner from '../Common/ElementorBanner'; |
| 5 |
import { styled } from '@linaria/react'; |
| 6 |
import { __ } from '@wordpress/i18n'; |
| 7 |
|
| 8 |
const Container = styled.div` |
| 9 |
padding-bottom: 8px; |
| 10 |
`; |
| 11 |
|
| 12 |
interface IMeetingWarningPros { |
| 13 |
onConnectCalendar: React.MouseEventHandler<HTMLButtonElement>; |
| 14 |
status: string; |
| 15 |
} |
| 16 |
|
| 17 |
export default function MeetingWarning({ |
| 18 |
onConnectCalendar, |
| 19 |
status, |
| 20 |
}: IMeetingWarningPros) { |
| 21 |
const isMeetingOwner = status === CURRENT_USER_CALENDAR_MISSING; |
| 22 |
const titleText = isMeetingOwner |
| 23 |
? __('Your calendar is not connected', 'leadin') |
| 24 |
: __('Calendar is not connected', 'leadin'); |
| 25 |
const titleMessage = isMeetingOwner |
| 26 |
? __( |
| 27 |
'Please connect your calendar to activate your scheduling pages', |
| 28 |
'leadin' |
| 29 |
) |
| 30 |
: __( |
| 31 |
'Make sure that everybody in this meeting has connected their calendar from the Meetings page in HubSpot', |
| 32 |
'leadin' |
| 33 |
); |
| 34 |
return ( |
| 35 |
<Fragment> |
| 36 |
<Container> |
| 37 |
<ElementorBanner type="warning"> |
| 38 |
<b>{titleText}</b> |
| 39 |
<br /> |
| 40 |
{titleMessage} |
| 41 |
</ElementorBanner> |
| 42 |
</Container> |
| 43 |
{isMeetingOwner && ( |
| 44 |
<ElementorButton |
| 45 |
id="meetings-connect-calendar" |
| 46 |
onClick={onConnectCalendar} |
| 47 |
> |
| 48 |
{__('Connect calendar', 'leadin')} |
| 49 |
</ElementorButton> |
| 50 |
)} |
| 51 |
</Fragment> |
| 52 |
); |
| 53 |
} |
| 54 |
|