stripe
This commit is contained in:
1 parent
01c0e9ef4d
commit
1b162578c2
22 files changed
+450
-72
No files matched your search
@@ -7,7 +7,12 @@ import Tooltip from "@mui/material/Tooltip";
|
||||
import { useSelector } from "react-redux";
|
||||
import type { RootState } from "@/store";
|
||||
import { useMemo } from "react";
|
||||
import type { EntitlemenstKey } from "@/types/entitlements";
|
||||
type EntitlementsKey =
|
||||
| "monitorsMax"
|
||||
| "notificationChannelsMax"
|
||||
| "statusPagesMax"
|
||||
| "checksIntervalMsMin"
|
||||
| "teamsMax";
|
||||
export const HeaderCreate = ({
|
||||
label,
|
||||
isLoading,
|
||||
@@ -18,7 +23,7 @@ export const HeaderCreate = ({
|
||||
label?: string;
|
||||
isLoading: boolean;
|
||||
path: string;
|
||||
entitlement: EntitlemenstKey | null;
|
||||
entitlement: EntitlementsKey | null;
|
||||
entitlementCount: number;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
@@ -29,7 +34,7 @@ export const HeaderCreate = ({
|
||||
if (!entitlement) return false;
|
||||
if (!ent || typeof ent[entitlement] !== "number") return false;
|
||||
return entitlementCount < ent[entitlement] ? false : true;
|
||||
}, [ent, entitlementCount]);
|
||||
}, [ent, entitlement, entitlementCount]);
|
||||
return (
|
||||
<Stack
|
||||
direction="row"
|
||||
|
||||
@@ -32,7 +32,6 @@ interface BasePageWithStatesProps extends StackProps {
|
||||
error: any;
|
||||
items: any[];
|
||||
bullets: string[] | unknown;
|
||||
|
||||
page: string;
|
||||
actionButtonText: string;
|
||||
actionLink: string;
|
||||
@@ -83,6 +82,7 @@ interface MonitorBasePageWithStatesProps extends StackProps {
|
||||
loading: boolean;
|
||||
error: any;
|
||||
items: any[];
|
||||
monitorLimitReached: boolean;
|
||||
page: string;
|
||||
actionLink?: string;
|
||||
children: React.ReactNode;
|
||||
@@ -100,6 +100,7 @@ export const MonitorBasePageWithStates: React.FC<
|
||||
loading,
|
||||
error,
|
||||
items,
|
||||
monitorLimitReached,
|
||||
page,
|
||||
actionLink,
|
||||
children,
|
||||
@@ -130,6 +131,7 @@ export const MonitorBasePageWithStates: React.FC<
|
||||
bullets={t(`${page}Monitor.fallback.checks`, { returnObjects: true })}
|
||||
actionButtonText={t(`${page}Monitor.fallback.actionButton`)}
|
||||
actionLink={actionLink || ""}
|
||||
monitorLimitReached={monitorLimitReached}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,12 +123,14 @@ export const EmptyMonitorFallback = ({
|
||||
bullets,
|
||||
actionButtonText,
|
||||
actionLink,
|
||||
monitorLimitReached,
|
||||
}: {
|
||||
page: string;
|
||||
title: string;
|
||||
bullets: any;
|
||||
actionButtonText: string;
|
||||
actionLink: string;
|
||||
monitorLimitReached: boolean;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
@@ -158,8 +160,9 @@ export const EmptyMonitorFallback = ({
|
||||
variant="contained"
|
||||
color="accent"
|
||||
onClick={() => navigate(actionLink)}
|
||||
disabled={monitorLimitReached}
|
||||
>
|
||||
{actionButtonText}
|
||||
{monitorLimitReached ? "Monitor limit reached" : actionButtonText}
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
Reference in new issue
Block a user