From f4a84eec635e488868f221d6038c995de755e4e4 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Tue, 10 Jan 2023 18:58:15 +0100 Subject: [PATCH] Hide no credits banner for no billing accounts --- .../components/LowCreditBalanceHint/LowCreditBalanceHint.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airbyte-webapp/src/packages/cloud/views/credits/CreditsPage/components/LowCreditBalanceHint/LowCreditBalanceHint.tsx b/airbyte-webapp/src/packages/cloud/views/credits/CreditsPage/components/LowCreditBalanceHint/LowCreditBalanceHint.tsx index 63aa9f4c6634..3428a4a2125a 100644 --- a/airbyte-webapp/src/packages/cloud/views/credits/CreditsPage/components/LowCreditBalanceHint/LowCreditBalanceHint.tsx +++ b/airbyte-webapp/src/packages/cloud/views/credits/CreditsPage/components/LowCreditBalanceHint/LowCreditBalanceHint.tsx @@ -3,6 +3,7 @@ import { FormattedMessage } from "react-intl"; import { InfoBox } from "components/ui/InfoBox"; +import { CreditStatus } from "packages/cloud/lib/domain/cloudWorkspaces/types"; import { useGetCloudWorkspace } from "packages/cloud/services/workspaces/CloudWorkspacesService"; import { useCurrentWorkspace } from "services/workspaces/WorkspacesService"; @@ -14,7 +15,9 @@ export const LowCreditBalanceHint: React.FC> = const workspace = useCurrentWorkspace(); const cloudWorkspace = useGetCloudWorkspace(workspace.workspaceId); - if (cloudWorkspace.remainingCredits > LOW_BALANCE_CREDIT_TRESHOLD) { + const isNoBillingAccount = + cloudWorkspace.remainingCredits <= 0 && cloudWorkspace.creditStatus === CreditStatus.POSITIVE; + if (isNoBillingAccount || cloudWorkspace.remainingCredits > LOW_BALANCE_CREDIT_TRESHOLD) { return null; }