import { forwardRef } from 'react'; import { __ } from '@wordpress/i18n'; import { burst_get_website_url } from '@/utils/lib'; interface IntroMeta { has_integrations: boolean; } interface IntegrationsIntroFieldProps { field: { name: string; value: unknown; onChange: ( value: unknown ) => void; }; fieldState: { error?: { message?: string }; }; setting: { meta?: IntroMeta; [key: string]: unknown; }; } /** * Intro panel for the Integrations settings tab. * * Shows a short intro line and, when no integrations are detected, an empty-state * message with a discovery link. When integrations are present, shows only the intro * line and a subtle "View all supported integrations" link. */ const IntegrationsIntroField = forwardRef( ({ setting }) => { const hasIntegrations = setting?.meta?.has_integrations ?? false; const integrationsUrl = burst_get_website_url( 'integrations/' ); if ( ! hasIntegrations ) { return (

{ __( 'No compatible plugins detected. Burst integrates with WooCommerce, Contact Form 7, Elementor, and more.', 'burst-statistics' ) }

{ __( 'View all supported integrations', 'burst-statistics' ) }
); } return (

{ __( 'Burst automatically detects compatible plugins and tracks relevant events. Disable an integration if you don\'t want Burst to interact with it.', 'burst-statistics' ) }

{ __( 'View all supported integrations', 'burst-statistics' ) }
); } ); IntegrationsIntroField.displayName = 'IntegrationsIntroField'; export default IntegrationsIntroField;