Skip to content

Commit

Permalink
chore: remove unused type
Browse files Browse the repository at this point in the history
  • Loading branch information
svedova committed Jun 12, 2024
1 parent 099bc21 commit 27fda74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ const paymentLinks: Record<SubscriptionName, string> = {
medium: "https://buy.stripe.com/test_00g6pW3W06wn6YM8wE",
enterprise: "https://buy.stripe.com/test_6oE5lS8cg8Evcj6cMT",
"self-hosted": "https://buy.stripe.com/test_5kAaGc648g6X82QaER",
"self-hosted-premium": "",
},
prod: {
free: "",
starter: "https://buy.stripe.com/9AQbLQafd1hh0rS3ck",
medium: "https://buy.stripe.com/5kA5ns7317FFgqQdQX",
enterprise: "https://buy.stripe.com/4gw17cbjhe43eiIbIO",
"self-hosted": "https://buy.stripe.com/6oEg26cnlcZZeiIeUZ",
"self-hosted-premium": "",
},
}[process.env.NODE_ENV === "development" ? "dev" : "prod"];

Expand All @@ -35,7 +33,6 @@ const prices: Record<SubscriptionName, number> = {
medium: 75,
enterprise: 150,
"self-hosted": 39,
"self-hosted-premium": 0,
};

interface Props {
Expand Down Expand Up @@ -102,9 +99,7 @@ export default function Checkout({ user }: Props) {
onSelect={i => setEdition(i[0] as Edition)}
/>
<Box sx={{ mt: 4 }}>
{includedFeatures(
edition === "limited" ? "self-hosted" : "self-hosted-premium"
).map(feature => (
{includedFeatures("self-hosted", edition).map(feature => (
<Box sx={{ mb: 1 }} key={feature.text}>
{feature.included ? (
<CheckIcon sx={{ fill: "green", mr: 2, ml: 0 }} />
Expand Down
25 changes: 13 additions & 12 deletions src/pages/user/account/_components/WhatsIncluded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ const limits: Record<SubscriptionName, { fns: string; bandwidth: string }> = {
fns: "Unlimited",
bandwidth: "Unlimited",
},
"self-hosted-premium": {
fns: "Unlimited",
bandwidth: "Unlimited",
},
};

interface Feature {
text: string;
included: boolean;
}

export const includedFeatures = (tier: SubscriptionName) => {
export const includedFeatures = (tier: SubscriptionName, edition?: Edition) => {
const shared: Feature[] = [
{ included: true, text: "Unlimited seats" },
{ included: true, text: "Unlimited teams" },
Expand All @@ -61,27 +57,27 @@ export const includedFeatures = (tier: SubscriptionName) => {
text: tier === "self-hosted" ? "Up to 5 seats" : "Unlimited seats",
},
{
included: tier === "self-hosted-premium",
included: edition === "premium",
text: "Analytics",
},
{
included: tier === "self-hosted-premium",
included: edition === "premium",
text: "Audit Logs",
},
// {
// included: tier === "self-hosted-premium",
// text: "Prerendering",
// },
{
included: tier === "self-hosted-premium",
included: edition === "premium",
text: "IP Limiting",
},
{
included: tier === "self-hosted-premium",
included: edition === "premium",
text: "Premium support",
},
{
included: tier === "self-hosted-premium",
included: edition === "premium",
text: "Custom features",
},
];
Expand All @@ -90,15 +86,20 @@ export const includedFeatures = (tier: SubscriptionName) => {
return [...shared, { included: true, text: "All features" }];
};

export default function WhatsIncluded({ tier }: { tier: SubscriptionName }) {
interface Props {
tier: SubscriptionName;
edition?: Edition;
}

export default function WhatsIncluded({ tier, edition }: Props) {
return (
<Box sx={{ display: "flex", mt: 2 }}>
<Grid
container
sx={{ width: "100%", textAlign: "left" }}
rowSpacing={{ xs: 2 }}
>
{includedFeatures(tier).map((feature, index) => (
{includedFeatures(tier, edition).map((feature, index) => (
<Grid
key={index}
item
Expand Down

0 comments on commit 27fda74

Please sign in to comment.