/** * External dependencies */ import apiFetch from '@wordpress/api-fetch'; import { __ } from '@wordpress/i18n'; import { useEffect, useState } from '@wordpress/element'; import { Card, CardBody, Flex, FlexItem, Button, Notice } from '@wordpress/components'; /** * Internal dependencies */ import { useWindowSize } from '../../shared/hooks'; import { getCourierLogo } from '../../shared/utils/getAsset'; interface WelcomeCardProps { startLogin: () => void; isLoading: boolean; isLinked: boolean; error: string | null; } export default function WelcomeCard( { startLogin, isLoading, isLinked, error }: WelcomeCardProps ) { const { width } = useWindowSize(); const isNarrow = width > 0 && width < 600; const logo = getCourierLogo('p2g'); return ( Parcel2Go

{__('Welcome to Parcel2Go', 'parcel2go-shipping')}

{__( 'Shipping made easy, with access to trusted courier services, competitive rates & 24/7 shipping support - saving you time & money.', 'parcel2go-shipping' )}

{isLoading ? ( ) : isLinked ? ( ) : ( )}
{error && (
{error}
)}
); }