Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
improvement: plans comparison & updated UI of pricing (#1031)
Ameer Al Ashhabd7525801928f
diff --git a/apps/web/components/icons/QuestionMarkIcon.tsx b/apps/web/components/icons/QuestionMarkIcon.tsxnew file mode 100644index 000000000..ca49b1ee5--- /dev/null+++ b/apps/web/components/icons/QuestionMarkIcon.tsx@@ -0,0 +1,23 @@+interface QuestionMarkIconProps {+ className?: string;+}++export const QuestionMarkIcon = ({ className }: QuestionMarkIconProps) => {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ className={className}+ viewBox="0 0 24 24"+ >+ <circle cx="12" cy="12" r="10"></circle>+ <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"></path>+ </svg>+ );+};diff --git a/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx b/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsxindex 1957b4210..5a1f427a1 100644--- a/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx+++ b/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx@@ -1,4 +1,5 @@import { Fit, Layout, useRive } from "@rive-app/react-canvas";+import clsx from "clsx";import { forwardRef, memo, useImperativeHandle } from "react";export interface CommercialArtRef {@@ -6,8 +7,12 @@ export interface CommercialArtRef {playDefaultAnimation: () => void;}+interface Props {+ className?: string;+}+export const CommercialArt = memo(- forwardRef<CommercialArtRef>((_, ref) => {+ forwardRef<CommercialArtRef, Props>((props, ref) => {const { rive, RiveComponent: CommercialRive } = useRive({src: "/rive/pricing.riv",artboard: "commercial",@@ -34,7 +39,12 @@ export const CommercialArt = memo(}));return (- <CommercialRive className="w-full max-w-[200px] mx-auto h-[175px]" />+ <CommercialRive+ className={clsx(+ "w-full max-w-[100px] mx-auto h-[80px]",+ props.className,+ )}+ />);}),);diff --git a/apps/web/components/pages/HomePage/Pricing/CommercialCard.tsx b/apps/web/components/pages/HomePage/Pricing/CommercialCard.tsxindex fe2ad1374..f0e5b4ac6 100644--- a/apps/web/components/pages/HomePage/Pricing/CommercialCard.tsx+++ b/apps/web/components/pages/HomePage/Pricing/CommercialCard.tsx@@ -1,11 +1,18 @@import { Button, Switch } from "@cap/ui";-import { faCheck, faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";+import {+ faBriefcase,+ faDownload,+ faMinus,+ faPlus,+ faVideo,+} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import NumberFlow from "@number-flow/react";import clsx from "clsx";import { useRef, useState } from "react";import { toast } from "sonner";import { homepageCopy } from "../../../../data/homepage-copy";+import { QuestionMarkIcon } from "../../../icons/QuestionMarkIcon";import { CommercialArt, type CommercialArtRef } from "./CommercialArt";export const CommercialCard = () => {@@ -64,18 +71,18 @@ export const CommercialCard = () => {className="flex flex-col flex-1 justify-between p-8 rounded-2xl border shadow-lg bg-gray-1 border-gray-5"><div>- <div className="md:h-[300px]">+ <div><CommercialArt ref={commercialArtRef} />- <h3 className="mb-2 text-2xl text-center text-gray-12">+ <h3 className="mb-2 text-xl font-semibold text-center text-gray-12">{homepageCopy.pricing.commercial.title}</h3>- <p className="mb-2 text-base text-center text-gray-10 w-full max-w-[285px] mx-auto">+ <p className="mb-3 text-sm text-center text-gray-11 w-full max-w-[285px] mx-auto font-medium">{homepageCopy.pricing.commercial.description}</p>- <div className="text-center">+ <div className="mb-6 text-center"><ahref="/docs/commercial-license"- className="text-sm underline text-gray-10 hover:text-gray-12"+ className="text-xs underline text-gray-10 hover:text-gray-12">Learn more about the commercial license here</a>@@ -83,15 +90,15 @@ export const CommercialCard = () => {</div><div className="mb-6 text-center">- <span className="text-5xl tabular-nums text-gray-12">+ <span className="text-3xl tabular-nums text-gray-12">$<NumberFlow value={currentPrice} /></span>- <span className="text-lg tabular-nums text-gray-10">+ <span className="text-base tabular-nums text-gray-10">{" "}/ {billingCycleText}</span>{isYearly ? (- <p className="text-lg tabular-nums text-gray-10">+ <p className="text-sm tabular-nums text-gray-10">or, $<NumberFlowvalue={licenses * COMMERCIAL_LICENSE_LIFETIME_PRICE}@@ -99,7 +106,7 @@ export const CommercialCard = () => {one-time payment</p>) : (- <p className="text-lg tabular-nums text-gray-10">+ <p className="text-sm tabular-nums text-gray-10">or, $<NumberFlow value={licenses * COMMERCIAL_LICENSE_YEARLY_PRICE} />{" "}/ year@@ -163,21 +170,43 @@ export const CommercialCard = () => {</div></div></div>+ </div>- <ul className="mb-8 space-y-4">- {homepageCopy.pricing.commercial.features.map((feature) => (- <li- key={feature}- className="flex items-start text-base text-gray-12"+ <div className="mb-6">+ <ul className="space-y-3">+ <li className="flex items-center text-sm text-gray-12">+ <FontAwesomeIcon+ icon={faBriefcase}+ className="flex-shrink-0 mr-3 text-gray-12"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span>Commercial usage</span>+ <a+ href="/docs/commercial-license"+ target="_blank"+ rel="noopener noreferrer"+ className="ml-1.5 text-gray-10 hover:text-gray-12 transition-colors"+ aria-label="Learn more about commercial license">- <FontAwesomeIcon- icon={faCheck}- className="mr-3 mt-0.5 text-gray-12 flex-shrink-0"- style={{ fontSize: "18px", minWidth: "18px" }}- />- <span className="leading-6">{feature}</span>- </li>- ))}+ <QuestionMarkIcon className="size-3.5" />+ </a>+ </li>+ <li className="flex items-center text-sm text-gray-12">+ <FontAwesomeIcon+ icon={faVideo}+ className="flex-shrink-0 mr-3 text-gray-12"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span>Unlimited local recordings</span>+ </li>+ <li className="flex items-center text-sm text-gray-12">+ <FontAwesomeIcon+ icon={faDownload}+ className="flex-shrink-0 mr-3 text-gray-12"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span>Export to MP4 or GIF</span>+ </li></ul></div>diff --git a/apps/web/components/pages/HomePage/Pricing/ProArt.tsx b/apps/web/components/pages/HomePage/Pricing/ProArt.tsxindex a622cb9e5..c9588e377 100644--- a/apps/web/components/pages/HomePage/Pricing/ProArt.tsx+++ b/apps/web/components/pages/HomePage/Pricing/ProArt.tsx@@ -40,10 +40,7 @@ export const ProArt = memo(return (<ProRive- className={clsx(- className,- "relative bottom-5 mx-auto w-full max-w-[210px] h-[195px]",- )}+ className={clsx(className, "mx-auto w-full max-w-[100px] h-[80px]")}/>);}),diff --git a/apps/web/components/pages/HomePage/Pricing/ProCard.tsx b/apps/web/components/pages/HomePage/Pricing/ProCard.tsxindex 68846d399..41a1a869f 100644--- a/apps/web/components/pages/HomePage/Pricing/ProCard.tsx+++ b/apps/web/components/pages/HomePage/Pricing/ProCard.tsx@@ -1,10 +1,16 @@import { Button, Switch } from "@cap/ui";import { getProPlanId } from "@cap/utils";-import { faCheck, faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";+import {+ faCloud,+ faLink,+ faMagic,+ faMinus,+ faPlus,+ faUsers,+} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import NumberFlow from "@number-flow/react";import clsx from "clsx";-import { useRouter } from "next/navigation";import { useRef, useState } from "react";import { toast } from "sonner";import { homepageCopy } from "../../../../data/homepage-copy";@@ -16,7 +22,6 @@ export const ProCard = () => {const [proLoading, setProLoading] = useState(false);const [guestLoading, setGuestLoading] = useState(false);const proArtRef = useRef<ProArtRef>(null);- const { push } = useRouter();const CAP_PRO_ANNUAL_PRICE_PER_USER = homepageCopy.pricing.pro.pricing.annual;const CAP_PRO_MONTHLY_PRICE_PER_USER =@@ -109,30 +114,30 @@ export const ProCard = () => {{homepageCopy.pricing.pro.badge}</span></div>- <div className="md:h-[300px]">+ <div className="md:h-[180px]"><ProArt ref={proArtRef} />- <h3 className="mb-2 text-2xl text-center">+ <h3 className="mb-2 text-xl font-semibold text-center">{homepageCopy.pricing.pro.title}</h3>- <p className="mb-6 text-base text-center text-gray-8">+ <p className="mb-4 text-sm font-medium text-center text-gray-9">{homepageCopy.pricing.pro.description}</p></div><div className="mb-6 text-center">- <span className="mr-2 text-5xl tabular-nums text-gray-1">+ <span className="mr-2 text-3xl tabular-nums text-gray-1">$<NumberFlow suffix="/mo" value={currentTotalPricePro} /></span>- <span className="text-lg tabular-nums text-gray-8">+ <span className="text-base tabular-nums text-gray-8">{" "}{billingCycleTextPro}</span>{isAnnually ? (- <p className="text-lg text-gray-8">+ <p className="text-sm text-gray-8">or,{" "}<NumberFlowvalue={CAP_PRO_MONTHLY_PRICE_PER_USER * users}- className="text-lg tabular-nums"+ className="text-sm tabular-nums"format={{notation: "compact",style: "currency",@@ -145,18 +150,18 @@ export const ProCard = () => {) : (<>for{" "}- <NumberFlow value={users} className="text-lg tabular-nums" />{" "}+ <NumberFlow value={users} className="text-sm tabular-nums" />{" "}users,{" "}</>)}billed monthly</p>) : (- <p className="text-lg text-gray-8">+ <p className="text-sm text-gray-8">or,{" "}<NumberFlowvalue={CAP_PRO_ANNUAL_PRICE_PER_USER * users}- className="text-lg tabular-nums"+ className="text-sm tabular-nums"format={{notation: "compact",style: "currency",@@ -169,7 +174,7 @@ export const ProCard = () => {) : (<>for{" "}- <NumberFlow value={users} className="text-lg tabular-nums" />{" "}+ <NumberFlow value={users} className="text-sm tabular-nums" />{" "}users,{" "}</>)}@@ -237,14 +242,48 @@ export const ProCard = () => {</div></div></div>+ </div>- <ul className="mb-8 space-y-3 text-base">- {homepageCopy.pricing.pro.features.map((feature) => (- <li key={feature} className="flex items-center text-gray-1">- <FontAwesomeIcon icon={faCheck} className="mr-2 text-gray-1" />- {feature}- </li>- ))}+ <div className="mb-6">+ <ul className="space-y-3">+ <li className="flex items-center text-sm text-gray-1">+ <FontAwesomeIcon+ icon={faCloud}+ className="flex-shrink-0 mr-3 text-gray-4"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span className="text-gray-4">+ Unlimited cloud storage & shareable links+ </span>+ </li>+ <li className="flex items-center text-sm text-gray-1">+ <FontAwesomeIcon+ icon={faMagic}+ className="flex-shrink-0 mr-3 text-gray-4"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span className="text-gray-4">+ Automatic AI title, transcription, summary, and chapter generation+ </span>+ </li>+ <li className="flex items-center text-sm">+ <FontAwesomeIcon+ icon={faLink}+ className="flex-shrink-0 mr-3 text-gray-4"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span className="text-gray-4">+ Connect a custom domain, e.g. cap.yourdomain.com+ </span>+ </li>+ <li className="flex items-center text-sm text-gray-1">+ <FontAwesomeIcon+ icon={faUsers}+ className="flex-shrink-0 mr-3 text-gray-4"+ style={{ fontSize: "14px", minWidth: "14px" }}+ />+ <span className="text-gray-4">Shared team spaces</span>+ </li></ul></div>diff --git a/apps/web/components/pages/PricingPage.tsx b/apps/web/components/pages/PricingPage.tsxindex 5839ae8bf..88b2347c7 100644--- a/apps/web/components/pages/PricingPage.tsx+++ b/apps/web/components/pages/PricingPage.tsx@@ -1,9 +1,18 @@"use client";-import { faHeart } from "@fortawesome/free-solid-svg-icons";+import { Button } from "@cap/ui";+import {+ faDownload,+ faHandshake,+ faHeart,+ faServer,+ faShield,+ faUsers,+} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { motion } from "framer-motion";import { Testimonials } from "../ui/Testimonials";+import ComparePlans from "./_components/ComparePlans";import Faq from "./HomePage/Faq";import { CommercialCard, ProCard } from "./HomePage/Pricing";@@ -62,7 +71,7 @@ export const PricingPage = () => {return (<motion.div initial="hidden" animate="visible" variants={staggerContainer}>- <div className="py-32 space-y-24 md:py-40 wrapper">+ <div className="py-32 space-y-[100px] md:py-40 wrapper"><div><motion.div className="mb-8 text-center" variants={fadeIn} custom={0}><motion.h1@@ -109,42 +118,110 @@ export const PricingPage = () => {</motion.div></div>+ {/* Comparison Table (Cap Pro vs Desktop License) */}+ <div>+ <ComparePlans />+ </div>++ {/* Enterprise Card */}<motion.div- variants={fadeIn}- custom={4}- initial="hidden"- whileInView="visible"- viewport={{ once: true, margin: "-100px" }}+ className="mx-auto w-full wrapper"+ variants={fadeInFromBottom}+ custom={1}>- <Faq />+ <div className="relative p-8 text-white rounded-2xl shadow-2xl md:p-12 bg-gray-12">+ <div className="w-full">+ <div className="md:flex md:justify-between">+ <div>+ <h2 className="mb-4 text-3xl font-semibold md:text-4xl">+ Cap for Enterprise+ </h2>+ <p className="mb-8 max-w-xl text-lg text-gray-4">+ Deploy Cap across your organization with enterprise-grade+ features, dedicated support, and custom integrations.+ </p>+ </div>+ <div>+ <Button+ variant="gray"+ size="lg"+ className="px-8 font-medium"+ onClick={() =>+ window.open("https://cal.com/cap.so/15min", "_blank")+ }+ >+ Book a Call+ </Button>+ </div>+ </div>++ <div className="grid grid-cols-1 gap-6 mb-10 max-w-3xl md:grid-cols-2 lg:grid-cols-3">+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faShield}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">SLAs & Priority Support</span>+ </div>+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faDownload}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">Loom Video Importer</span>+ </div>+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faHandshake}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">Bulk Discounts</span>+ </div>+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faServer}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">Self-hosting Support</span>+ </div>+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faUsers}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">SAML SSO Login</span>+ </div>+ <div className="flex gap-3 items-center">+ <FontAwesomeIcon+ icon={faShield}+ className="flex-shrink-0 text-blue-400"+ style={{ fontSize: "20px" }}+ />+ <span className="text-gray-3">+ Advanced Security Controls+ </span>+ </div>+ </div>+ </div>+ </div></motion.div>- <motion.div- className="mb-32 wrapper"- id="testimonials"- variants={fadeIn}- custom={5}- >+ <div>+ <Faq />+ </div>++ <div className="mb-32 wrapper" id="testimonials"><Testimonialsamount={24}title="What our users say about Cap after hitting record"subtitle="Don't just take our word for it. Here's what our users are saying about their experience with Cap."/>- </motion.div>-- <motion.div- variants={fadeIn}- custom={6}- initial="hidden"- whileInView="visible"- viewport={{ once: true, margin: "-100px" }}- >- <img- className="mx-auto w-full h-auto rounded-xl shadow-lg"- src="/illustrations/comparison.png"- alt="Cap vs Competitors Table"- />- </motion.div>+ </div></div></motion.div>);diff --git a/apps/web/components/pages/_components/ComparePlans.tsx b/apps/web/components/pages/_components/ComparePlans.tsxnew file mode 100644index 000000000..51e741a09--- /dev/null+++ b/apps/web/components/pages/_components/ComparePlans.tsx@@ -0,0 +1,412 @@+"use client";++import { Button } from "@cap/ui";+import { getProPlanId, userIsPro } from "@cap/utils";+import { faCheckCircle } from "@fortawesome/free-solid-svg-icons";+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { clsx } from "clsx";+import { use, useMemo, useRef, useState } from "react";+import { toast } from "sonner";+import { useAuthContext } from "@/app/Layout/AuthContext";+import {+ CommercialArt,+ CommercialArtRef,+} from "../HomePage/Pricing/CommercialArt";+import { ProArt, ProArtRef } from "../HomePage/Pricing/ProArt";++const COLUMN_WIDTH = "min-w-[200px]";++type Plan = {+ name: string;+ price: string;+ href?: string;+ disabled?: boolean;+};++const getButtonText = (planName: string): string => {+ switch (planName) {+ case "Free":+ return "Download for free";+ case "Desktop License":+ return "Get Desktop License";+ case "Cap Pro":+ return "Get started";+ default:+ return "Get started";+ }+};++const getButtonVariant = (planName: string) => {+ switch (planName) {+ case "Free":+ return "gray";+ case "Desktop License":+ return "dark";+ case "Cap Pro":+ return "blue";+ default:+ return "gray";+ }+};++// Icon component renderer+const PlanIcon = ({+ planName,+ commercialArtRef,+ proArtRef,+}: {+ planName: string;+ commercialArtRef: React.RefObject<CommercialArtRef>;+ proArtRef: React.RefObject<ProArtRef>;+}) => {+ if (planName === "Desktop License") {+ return (+ <div+ onMouseEnter={() => commercialArtRef.current?.playHoverAnimation()}+ onMouseLeave={() => commercialArtRef.current?.playDefaultAnimation()}+ className="w-[90px] h-[80px]"+ >+ <CommercialArt className="w-[80px] h-[80px]" ref={commercialArtRef} />+ </div>+ );+ }++ if (planName === "Cap Pro") {+ return (+ <div+ onMouseEnter={() => proArtRef.current?.playHoverAnimation()}+ onMouseLeave={() => proArtRef.current?.playDefaultAnimation()}+ className="w-[90px] ml-2 h-[80px]"+ >+ <ProArt ref={proArtRef} className="w-16 h-[98px]" />+ </div>+ );+ }++ return null;+};++export const ComparePlans = () => {+ const commercialArtRef = useRef<CommercialArtRef>(null);+ const proArtRef = useRef<ProArtRef>(null);+ const auth = use(useAuthContext().user);+ const [proLoading, setProLoading] = useState(false);+ const [guestLoading, setGuestLoading] = useState(false);+ const [commercialLoading, setCommercialLoading] = useState(false);++ // Check if user is already pro or any loading state is active+ const isDisabled = useMemo(+ () =>+ (auth?.email && userIsPro(auth)) ||+ proLoading ||+ guestLoading ||+ commercialLoading,+ [auth, proLoading, guestLoading, commercialLoading],+ );++ const plans: Plan[] = useMemo(+ () => [+ {+ name: "Free",+ price: "$0 forever",+ href: "/login",+ disabled: isDisabled,+ },+ {+ name: "Desktop License",+ price: "$58 /lifetime or $29 /year",+ disabled: isDisabled,+ },+ {+ name: "Cap Pro",+ price:+ "$8.16 /mo per user, billed annually or $12 /mo per user, billed monthly",+ disabled: isDisabled,+ },+ ],+ [isDisabled],+ );+ // Feature comparison data+ const rows = useMemo(+ () => [+ { label: "Unlimited recordings", free: false, desktop: true, pro: true },+ { label: "Commercial usage", free: false, desktop: true, pro: true },+ {+ label: "Studio Mode with full editor",+ free: true,+ desktop: true,+ pro: true,+ },+ { label: "Export to any format", free: true, desktop: true, pro: true },+ { label: "4K export", free: true, desktop: true, pro: true },+ {+ label: "Cloud storage & bandwidth",+ free: false,+ desktop: false,+ pro: "Unlimited",+ },+ {+ label: "Auto-generated titles & summaries",+ free: false,+ desktop: false,+ pro: true,+ },+ {+ label: "Clickable chapters & transcriptions",+ free: false,+ desktop: false,+ pro: true,+ },+ {+ label: "Custom domain (cap.yourdomain.com)",+ free: false,+ desktop: false,+ pro: true,+ },+ {+ label: "Password protected shares",+ free: false,+ desktop: false,+ pro: true,+ },+ {+ label: "Viewer analytics & engagement",+ free: false,+ desktop: false,+ pro: true,+ },+ { label: "Team workspaces", free: true, desktop: true, pro: true },+ {+ label: "Custom S3 bucket support",+ free: false,+ desktop: false,+ pro: true,+ },+ { label: "Priority support", free: false, desktop: false, pro: true },+ {+ label: "Early features access",+ free: false,+ desktop: false,+ pro: true,+ },+ { label: "Community support", free: true, desktop: true, pro: true },+ {+ label: "License type",+ free: "Free",+ desktop: "Perpetual (single device)",+ pro: "Subscription",+ },+ ],+ [],+ );++ // Generic checkout handler with error handling+ const handleCheckout = async (+ url: string,+ body: Record<string, any>,+ setLoading: (loading: boolean) => void,+ errorMessage: string,+ ) => {+ setLoading(true);+ try {+ const response = await fetch(url, {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify(body),+ });++ const data = await response.json();++ if (response.ok && data.url) {+ window.location.href = data.url;+ } else {+ throw new Error(data.message || errorMessage);+ }+ } catch (error) {+ console.error("Checkout error:", error);+ toast.error(errorMessage);+ } finally {+ setLoading(false);+ }+ };++ const guestCheckout = (planId: string) =>+ handleCheckout(+ "/api/settings/billing/guest-checkout",+ { priceId: planId, quantity: 1 },+ setGuestLoading,+ "Failed to create checkout session",+ );++ const openCommercialCheckout = () =>+ handleCheckout(+ "/api/commercial/checkout",+ { type: "lifetime", quantity: 1 },+ setCommercialLoading,+ "Failed to start checkout process",+ );++ const planCheckout = async (planId?: string) => {+ const finalPlanId = planId || getProPlanId("yearly");+ setProLoading(true);++ try {+ const response = await fetch("/api/settings/billing/subscribe", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ priceId: finalPlanId, quantity: 1 }),+ });++ const data = await response.json();++ if (data.auth === false) {+ // User not authenticated, do guest checkout+ setProLoading(false);+ await guestCheckout(finalPlanId);+ return;+ }++ if (data.subscription === true) {+ toast.success("You are already on the Cap Pro plan");+ return;+ }++ if (data.url) {+ window.location.href = data.url;+ }+ } catch (error) {+ console.error("Plan checkout error:", error);+ toast.error("Failed to start subscription process");+ } finally {+ setProLoading(false);+ }+ };++ const renderCell = (value: boolean | string) => {+ if (typeof value === "boolean") {+ return value ? (+ <FontAwesomeIcon+ className="text-emerald-500 size-4"+ icon={faCheckCircle}+ />+ ) : (+ <span className="text-gray-8">—</span>+ );+ }+ return <span className="text-gray-12">{value}</span>;+ };+ return (+ <div className="mx-auto w-full max-w-[1400px]">+ <h2 className="mb-6 text-center">Compare plans</h2>+ <div className="overflow-x-auto w-full">+ <div className="overflow-hidden rounded-xl border min-w-fit border-gray-5">+ <table className="w-full text-left border-separate border-spacing-0 bg-gray-2">+ <thead>+ <tr className="bg-gray-1">+ <th+ className={clsx(+ "px-4 text-sm font-medium text-gray-12",+ COLUMN_WIDTH,+ )}+ />+ {plans.map((plan) => (+ <th+ key={plan.name}+ className={clsx(+ "px-4 py-6 text-sm font-semibold text-gray-12",+ COLUMN_WIDTH,+ )}+ >+ <div className="flex flex-1 gap-2">+ <div className="flex-shrink-0">+ <PlanIcon+ planName={plan.name}+ commercialArtRef={commercialArtRef}+ proArtRef={proArtRef}+ />+ </div>+ <div className="flex flex-col flex-1 justify-center text-black">+ <p className="text-sm font-semibold text-gray-12">+ {plan.name}+ </p>+ <p className="mt-1 text-[15px] w-full min-w-[250px] max-w-[250px] font-medium text-gray-10">+ {plan.price}+ </p>+ </div>+ </div>+ </th>+ ))}+ </tr>+ <tr className="bg-gray-1">+ <th+ className={clsx(+ "px-4 pb-4 text-xs font-medium text-transparent border-b border-gray-5",+ COLUMN_WIDTH,+ )}+ >+ .+ </th>+ {plans.map((plan) => (+ <th+ key={plan.name + "-cta"}+ className={clsx(+ "px-4 pb-6 border-b border-gray-5",+ COLUMN_WIDTH,+ )}+ >+ <div className="space-y-2">+ <Button+ disabled={plan.disabled}+ href={plan.name === "Free" ? plan.href : undefined}+ className="w-fit"+ onClick={() => {+ if (plan.name === "Free") {+ window.location.href = "/download";+ }+ if (plan.name === "Desktop License") {+ openCommercialCheckout();+ } else {+ planCheckout();+ }+ }}+ size="sm"+ variant={getButtonVariant(plan.name)}+ >+ {getButtonText(plan.name)}+ </Button>+ </div>+ </th>+ ))}+ </tr>+ </thead>+ <tbody className="[&>tr+tr>td]:border-t [&>tr+tr>td]:border-gray-5">+ {rows.map((row) => (+ <tr key={row.label} className="bg-gray-2">+ <td+ className={clsx(+ "p-5 text-sm font-medium text-nowrap text-gray-11",+ COLUMN_WIDTH,+ )}+ >+ {row.label}+ </td>+ <td className={clsx("px-4 py-3 text-sm", COLUMN_WIDTH)}>+ {renderCell(row.free)}+ </td>+ <td className={clsx("px-4 py-3 text-sm", COLUMN_WIDTH)}>+ {renderCell(row.desktop)}+ </td>+ <td className={clsx("px-4 py-3 text-sm", COLUMN_WIDTH)}>+ {renderCell(row.pro)}+ </td>+ </tr>+ ))}+ </tbody>+ </table>+ </div>+ </div>+ </div>+ );+};++export default ComparePlans;diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsxindex 5bf6c7938..04eb65b15 100644--- a/packages/ui/src/components/Button.tsx+++ b/packages/ui/src/components/Button.tsx@@ -15,7 +15,7 @@ const buttonVariants = cva(variant: {primary:"bg-gray-12 dark-button-shadow text-gray-1 disabled:bg-gray-6 disabled:text-gray-9",- blue: "bg-blue-600 text-white border border-blue-800 shadow-[0_1.50px_0_0_rgba(255,255,255,0.20)_inset] hover:bg-blue-700 disabled:bg-gray-6 disabled:text-gray-9",+ blue: "bg-blue-600 text-white disabled:border-gray-8 border border-blue-800 shadow-[0_1.50px_0_0_rgba(255,255,255,0.20)_inset] hover:bg-blue-700 disabled:bg-gray-7 disabled:text-gray-10",destructive:"bg-red-500 text-white hover:bg-red-600 disabled:bg-red-200",outline: