import React from "react"; import styled from "styled-components"; import { Button, Text, TextType } from "design-system-old"; import { createMessage, IN_APP_EMBED_SETTING, } from "@appsmith/constants/messages"; import { getAppsmithConfigs } from "ce/configs"; import { PRICING_PAGE_URL } from "constants/ThirdPartyConstants"; import { useSelector } from "react-redux"; import { getInstanceId } from "ce/selectors/tenantSelectors"; const Container = styled.div<{ isAppSettings: boolean }>` ${({ isAppSettings }) => isAppSettings ? ` text-align: left; ` : ` text-align: left; .no-sub-img { margin: auto; } `} `; const SubContainer = styled.div<{ isAppSettings: boolean }>` ${({ isAppSettings }) => isAppSettings ? ` > span { margin: 1rem; } ` : ` > span { margin: 8px 0px; } > span:nth-child(2) { margin-bottom: 16px; } `} `; const StyledText = styled(Text)` display: block; font-size: 14px; &.upgrade-heading { font-weight: 600; font-size: 16px; } &.upgrade-heading-inapp { font-weight: 500; text-[color:var(--appsmith-color-black-800)]; } &.secondary-heading { font-weight: 500; text-[color:var(--appsmith-color-black-800)]; } `; const StyledAnchor = styled.a` text-decoration: underline; `; function PrivateEmbeddingContent(props: { canMakeAppPublic: boolean; changeTab?: () => void; isAppSettings?: boolean; }) { const { canMakeAppPublic = false, changeTab, isAppSettings = false } = props; const appsmithConfigs = getAppsmithConfigs(); const instanceId = useSelector(getInstanceId); return ( {canMakeAppPublic ? isAppSettings ? createMessage(IN_APP_EMBED_SETTING.upgradeHeadingForAppSettings) : createMessage(IN_APP_EMBED_SETTING.upgradeHeadingForInviteModal) : isAppSettings ? createMessage(IN_APP_EMBED_SETTING.upgradeHeadingForAppSettings) : createMessage(IN_APP_EMBED_SETTING.upgradeHeading)} {isAppSettings && ( {canMakeAppPublic ? createMessage( IN_APP_EMBED_SETTING.secondaryHeadingForAppSettings, ) : createMessage(IN_APP_EMBED_SETTING.secondaryHeading)} )} {createMessage(IN_APP_EMBED_SETTING.upgradeContent)}  { window.open( PRICING_PAGE_URL( appsmithConfigs.pricingUrl, appsmithConfigs.cloudHosting ? "Cloud" : "CE", instanceId, ), "_blank", ); }} rel="noreferrer" > {createMessage(IN_APP_EMBED_SETTING.appsmithBusinessEdition)} . {canMakeAppPublic && !isAppSettings && (