// #region [Imports] =================================================================================================== // Components import SidebarIcon from './SidebarIcon'; // Helpers import { sanitizeHtml } from '../../../../shared/helpers/sanitize'; // #endregion [Imports] // #region [Variables] ================================================================================================= declare var acfwAdminApp: any; // #endregion [Variables] // #region [Interfaces]================================================================================================= export interface IPluginStatus { key: string; name: string; campaign: string; status: string; } // #endregion [Interfaces] // #region [Component] ================================================================================================= const PluginStatus = (props: IPluginStatus & { itemKey: string }) => { const { name, campaign, status, itemKey } = props; const { dashboard_page: { labels }, } = acfwAdminApp; let statusHtml: string; if ('learn_more' === status) { let basePath = 'https://advancedcouponsplugin.com/pricing/'; let pluginPath = ''; // Determine the plugin-specific path switch (itemKey) { case 'acfwp': pluginPath = ''; break; case 'lpfw': pluginPath = 'loyalty/'; break; case 'agc': pluginPath = 'gift-cards/'; break; default: pluginPath = ''; } const link = `${basePath}${pluginPath}?utm_source=acfwf&utm_medium=dashboard&utm_campaign=${campaign}`; statusHtml = `${labels[status]}`; } else { statusHtml = `${labels[status]}`; } return ( <> ); }; export default PluginStatus; // #endregion [Component]