currency: getPriceCurrency()

in src/Explorer/Controls/Settings/SettingsRenderUtils.tsx [202:295]


    currency: getPriceCurrency(serverId),
    currencySign: getCurrencySign(serverId),
  };
};

export const getEstimatedSpendingElement = (
  costElement: JSX.Element,
  throughput: number,
  numberOfRegions: number,
  priceBreakdown: PriceBreakdown,
  isAutoscale: boolean,
): JSX.Element => {
  const ruRange: string = isAutoscale ? throughput / 10 + " RU/s - " : "";
  return (
    <Stack>
      <Text style={{ fontWeight: 600 }}>Cost estimate*</Text>
      {costElement}
      <Text style={{ fontWeight: 600, marginTop: 15 }}>How we calculate this</Text>
      <Stack id="throughputSpendElement" style={{ marginTop: 5 }}>
        <span>
          {numberOfRegions} region{numberOfRegions > 1 && <span>s</span>}
        </span>
        <span>
          {ruRange}
          {throughput} RU/s
        </span>
        <span>
          {priceBreakdown.currencySign}
          {priceBreakdown.pricePerRu}/RU
        </span>
      </Stack>
      <Text style={{ marginTop: 15 }}>
        <em>*{estimatedCostDisclaimer}</em>
      </Text>
    </Stack>
  );
};

export const manualToAutoscaleDisclaimerElement: JSX.Element = (
  <Text styles={infoAndToolTipTextStyle} id="manualToAutoscaleDisclaimerElement">
    The starting autoscale max RU/s will be determined by the system, based on the current manual throughput settings
    and storage of your resource. After autoscale has been enabled, you can change the max RU/s.{" "}
    <Link href={Urls.autoscaleMigration}>Learn more</Link>
  </Text>
);

export const ttlWarning: JSX.Element = (
  <Text styles={infoAndToolTipTextStyle}>
    The system will automatically delete items based on the TTL value (in seconds) you provide, without needing a delete
    operation explicitly issued by a client application. For more information see,{" "}
    <Link target="_blank" href="https://aka.ms/cosmos-db-ttl">
      Time to Live (TTL) in Azure Cosmos DB
    </Link>
    .
  </Text>
);

export const unsavedEditorWarningMessage = (editor: editorType): JSX.Element => (
  <Text styles={infoAndToolTipTextStyle}>
    You have not saved the latest changes made to your{" "}
    {editor === "indexPolicy" ? "indexing policy" : "computed properties"}. Please click save to confirm the changes.
  </Text>
);

export const updateThroughputDelayedApplyWarningMessage: JSX.Element = (
  <Text styles={infoAndToolTipTextStyle} id="updateThroughputDelayedApplyWarningMessage">
    You are about to request an increase in throughput beyond the pre-allocated capacity. This operation will take some
    time to complete.
  </Text>
);

export const getUpdateThroughputBeyondInstantLimitMessage = (instantMaximumThroughput: number): JSX.Element => {
  return (
    <Text styles={infoAndToolTipTextStyle} id="updateThroughputDelayedApplyWarningMessage">
      Scaling up will take 4-6 hours as it exceeds what Azure Cosmos DB can instantly support currently based on your
      number of physical partitions. You can increase your throughput to {instantMaximumThroughput} instantly or proceed
      with this value and wait until the scale-up is completed.
    </Text>
  );
};

export const getUpdateThroughputBeyondSupportLimitMessage = (
  instantMaximumThroughput: number,
  maximumThroughput: number,
): JSX.Element => {
  return (
    <>
      <Text styles={infoAndToolTipTextStyle} id="updateThroughputDelayedApplyWarningMessage">
        Your request to increase throughput exceeds the pre-allocated capacity which may take longer than expected.
        There are three options you can choose from to proceed:
      </Text>
      <ol style={{ fontSize: 14, color: "windowtext", marginTop: "5px" }}>
        <li>You can instantly scale up to {instantMaximumThroughput} RU/s.</li>
        {instantMaximumThroughput < maximumThroughput && (