import { __, sprintf } from '@wordpress/i18n' import { useSelect } from '@wordpress/data' import classNames from 'classnames' import { store } from '../../../store/backend' import { getUniquePlanBadges } from '../../../utilities/planHelper' import { buildFormTabBannerContent } from './proFeatureFormTabBannerContent' import { ResolvedFormField } from '../Form/types' import './ProFeatureBanner.scss' interface ProFeatureFormTabBannerProps { tabTitle: string requiredPlans: string[] lockedFields: ResolvedFormField[] } export const ProFeatureFormTabBanner = ({ tabTitle, requiredPlans, lockedFields, }: ProFeatureFormTabBannerProps) => { const { plugin_url, admin_url } = useSelect( (select) => select(store).getPreset(), [] ) const content = buildFormTabBannerContent(tabTitle, lockedFields) const upgradeUrl = sprintf('%sadmin.php?page=wbk-main-pricing', admin_url) const planBadges = getUniquePlanBadges(requiredPlans) return (
{plugin_url && ( )}

{content.title}

{planBadges.length > 0 && (
{__('Available in Pro', 'webba-booking-lite')} {/* {planBadges.map(({ plan, label }) => ( {label} ))} */}
)}

{content.headline}

{content.description}

{__('Upgrade', 'webba-booking-lite')} {__('Learn more', 'webba-booking-lite')}
) }