+
+ {addon.docs_url && (
+ }
+ size="small"
+ to={addon.docs_url}
+ tooltip="Read the docs"
/>
- >
- ) : addon.included_with_main_product ? (
- }>
- Included with plan
-
- ) : (
- <>
- {currentAndUpgradePlans?.upgradePlan?.flat_rate ? (
-
- ${Number(currentAndUpgradePlans?.upgradePlan?.unit_amount_usd)}
- /
- {currentAndUpgradePlans?.upgradePlan?.unit}
-
- ) : (
- {
- toggleIsPricingModalOpen()
- }}
- >
- View pricing
-
- )}
- {!addon.inclusion_only && (
- }
- size="small"
- disableClientSideRouting
- disabledReason={billingError && billingError.message}
- loading={billingProductLoading === addon.type}
- onClick={() =>
- initiateProductUpgrade(addon, currentAndUpgradePlans?.upgradePlan, redirectPath)
+ )}
+ {addon.subscribed && !addon.inclusion_only ? (
+ <>
+
+ {
+ setSurveyResponse(addon.type, '$survey_response_1')
+ reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, addon.type)
+ }}
+ >
+ Remove addon
+
+ >
}
- >
- Add
-
- )}
- >
+ />
+ >
+ ) : addon.included_with_main_product ? (
+ }>
+ Included with plan
+
+ ) : (
+ <>
+ {currentAndUpgradePlans?.upgradePlan?.flat_rate ? (
+
+
+ {formatFlatRate(Number(upgradePlan?.unit_amount_usd), upgradePlan?.unit)}
+
+
+ ) : (
+ {
+ toggleIsPricingModalOpen()
+ }}
+ >
+ View pricing
+
+ )}
+ {!addon.inclusion_only && (
+ }
+ size="small"
+ disableClientSideRouting
+ disabledReason={billingError && billingError.message}
+ loading={billingProductLoading === addon.type}
+ onClick={() =>
+ initiateProductUpgrade(
+ addon,
+ currentAndUpgradePlans?.upgradePlan,
+ redirectPath
+ )
+ }
+ >
+ Add
+
+ )}
+ >
+ )}
+
+ {!addon.inclusion_only && isProrated && (
+
+ ${prorationAmount} charged today (pro-rated),
+
+ then {formatFlatRate(Number(upgradePlan?.unit_amount_usd), upgradePlan?.unit)} starting next
+ invoice.
+
)}