Use plans from backend

This commit is contained in:
Jon Staab
2026-03-27 15:17:36 -07:00
parent caee3742bb
commit 6510bc0d85
7 changed files with 83 additions and 89 deletions
+5 -6
View File
@@ -7,6 +7,7 @@ import PricingTable from "@/components/PricingTable"
import ToggleButton from "@/components/ToggleButton"
import ToggleField from "@/components/ToggleField"
import { setToastMessage } from "@/components/Toast"
import { plans } from "@/lib/state"
function DetailSection(props: { title: string; children: any }) {
return (
@@ -61,13 +62,11 @@ export default function RelayDetailCard(props: RelayDetailCardProps) {
let menuContainerRef: HTMLDivElement | undefined
const memberLimitByPlan: Record<string, string> = {
free: "10",
basic: "100",
growth: "∞",
const memberLimitLabel = () => {
const p = plans().find(p => p.id === r().plan)
if (!p) return "?"
return p.members === null ? "∞" : String(p.members)
}
const memberLimitLabel = () => memberLimitByPlan[r().plan] ?? "?"
const planLimited = () => (props.enforcePlanLimits ?? true) && r().plan === "free"
const showPlanActions = () => props.showPlanActions ?? true