Spaces:
Running
Running
Download apps/web/src/lib/subscription.ts from Benaah/MicProtocol: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/web/src/lib/subscription.ts
- Command line
-
hf download hf://spaces/Benaah/MicProtocol/apps/web/src/lib/subscription.ts
-
curl -L -o subscription.ts https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/web/src/lib/subscription.ts
846 Bytes
| export type PlanId = "hobby" | "creator" | "studio"; | |
| export function getPlanIdFromBillingSettings(billingSettings: unknown): PlanId { | |
| const rawPlan = (billingSettings as any)?.subscription?.planId; | |
| if (rawPlan === "creator" || rawPlan === "studio" || rawPlan === "hobby") { | |
| return rawPlan; | |
| } | |
| return "hobby"; | |
| } | |
| export function getPlanBadgeConfig(planId: PlanId): { label: string; background: string; color: string } { | |
| if (planId === "creator") { | |
| return { | |
| label: "Creator", | |
| background: "rgba(108, 92, 231, 0.14)", | |
| color: "var(--color-primary)", | |
| }; | |
| } | |
| if (planId === "studio") { | |
| return { | |
| label: "Studio", | |
| background: "rgba(245, 158, 11, 0.18)", | |
| color: "#b45309", | |
| }; | |
| } | |
| return { | |
| label: "Hobby", | |
| background: "rgba(59, 130, 246, 0.12)", | |
| color: "#2563eb", | |
| }; | |
| } | |