Open source CapCut alternative.
TypeScript
fix(site): restore the shared pricing components the Cut landing imports
David Lecb6027ac2b29
diff --git a/site/src/app/_components/landing/PricingPlanCard.tsx b/site/src/app/_components/landing/PricingPlanCard.tsxnew file mode 100644index 00000000..69e64dc3--- /dev/null+++ b/site/src/app/_components/landing/PricingPlanCard.tsx@@ -0,0 +1,117 @@+"use client";++import { Check } from "lucide-react";++import {+ PillButton,+ TapedCard,+} from "@/app/_components/landing/LandingPrimitives";+import type { PricingPlan } from "@/app/_components/landing/pricingPlans";+import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";++type Props = {+ plan: PricingPlan;+};++export function PricingPlanCard({ plan }: Props) {+ const isDesktop = useMediaQuery("(min-width: 768px)");+ const action = plan.action;++ const button = (+ <PillButton href={action.href} variant="dark">+ {action.label}+ </PillButton>+ );++ return (+ <TapedCard+ color={plan.color}+ fill+ tapeColor={plan.tapeColor}+ tapePosition={plan.tapePosition}+ >+ <div+ style={{+ boxSizing: "border-box",+ display: "flex",+ flexDirection: "column",+ height: "100%",+ padding: isDesktop ? 36 : 28,+ }}+ >+ <div style={{ fontWeight: 600, fontSize: 22, marginBottom: 18 }}>+ {plan.name}+ </div>+ <div style={{ display: "flex", alignItems: "baseline", gap: 8 }}>+ <span+ style={{+ fontWeight: 600,+ fontSize: isDesktop ? 54 : 42,+ lineHeight: 0.95,+ }}+ >+ {plan.price}+ </span>+ </div>+ <div+ style={{+ fontSize: 13,+ fontWeight: 600,+ color: plan.color === "coral" ? "#201715" : "#444",+ marginBottom: 24,+ marginTop: 10,+ }}+ >+ {plan.detail}+ </div>+ <p+ style={{+ color: plan.color === "coral" ? "#1a1a1a" : "#222",+ fontSize: 15,+ lineHeight: 1.55,+ margin: "0 0 24px",+ }}+ >+ {plan.body}+ </p>+ <div+ style={{+ display: "grid",+ gap: 10,+ marginBottom: 28,+ }}+ >+ {plan.features.map((feature) => (+ <div+ key={feature}+ style={{+ alignItems: "center",+ display: "flex",+ gap: 10,+ fontSize: 14,+ fontWeight: 600,+ }}+ >+ <span+ style={{+ alignItems: "center",+ background: "#fff",+ border: "2px solid #0F0E0D",+ borderRadius: 999,+ display: "inline-flex",+ height: 24,+ justifyContent: "center",+ width: 24,+ }}+ >+ <Check size={14} />+ </span>+ <span>{feature}</span>+ </div>+ ))}+ </div>+ <div style={{ marginTop: "auto" }}>{button}</div>+ </div>+ </TapedCard>+ );+}diff --git a/site/src/app/_components/landing/pricingPlans.ts b/site/src/app/_components/landing/pricingPlans.tsnew file mode 100644index 00000000..c3421504--- /dev/null+++ b/site/src/app/_components/landing/pricingPlans.ts@@ -0,0 +1,22 @@+import type { CardColor } from "@/app/_components/landing/theme";++// The shape pricing cards render from. Donkey Use no longer sells through the+// site, so plans exist only where a product still lists them (Cut's landing —+// see cutPricingPlans.ts); every action is a plain link.+export type PricingPlanAction = {+ href: string;+ kind: "contact" | "link";+ label: string;+};++export type PricingPlan = {+ action: PricingPlanAction;+ body: string;+ color: CardColor;+ detail: string;+ features: string[];+ name: string;+ price: string;+ tapeColor: CardColor;+ tapePosition?: "left" | "right" | "center";+};diff --git a/site/src/app/_components/landing/useMediaQuery.ts b/site/src/app/_components/landing/useMediaQuery.tsnew file mode 100644index 00000000..74114c84--- /dev/null+++ b/site/src/app/_components/landing/useMediaQuery.ts@@ -0,0 +1,18 @@+"use client";++import { useSyncExternalStore } from "react";++export function useMediaQuery(query: string) {+ return useSyncExternalStore(+ (onStoreChange) => {+ const mediaQuery = window.matchMedia(query);+ mediaQuery.addEventListener("change", onStoreChange);++ return () => {+ mediaQuery.removeEventListener("change", onStoreChange);+ };+ },+ () => window.matchMedia(query).matches,+ () => false,+ );+}