Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

1.7 KB
Raw Blame
import type { Meta, StoryObj } from "@storybook/react-vite";
import StripeCheckout from "@editor/components/shared/stripeCheckout/StripeCheckout";
import type { PlanTierGroup } from "@editor/services/licenseService";

const PLAN_GROUP: PlanTierGroup = {
  tier: "server",
  name: "Server",
  monthly: {
    id: "server-monthly",
    name: "Server Monthly",
    price: 99,
    currency: "$",
    period: "monthly",
    features: [],
    highlights: ["Unlimited documents", "Priority support"],
    lookupKey: "selfhosted:team:monthly",
  },
  yearly: {
    id: "server-yearly",
    name: "Server Yearly",
    price: 990,
    currency: "$",
    period: "yearly",
    features: [],
    highlights: ["Unlimited documents", "Priority support", "2 months free"],
    lookupKey: "selfhosted:team:yearly",
  },
  features: [],
  highlights: ["Unlimited documents", "Priority support"],
};

/**
 * The multi-stage Stripe checkout modal (email -> plan selection -> payment -> success/error).
 */
const meta: Meta<typeof StripeCheckout> = {
  title: "StripeCheckout/StripeCheckout",
  component: StripeCheckout,
  parameters: { layout: "fullscreen" },
  args: {
    opened: true,
    onClose: () => {},
    planGroup: PLAN_GROUP,
    minimumSeats: 1,
  },
};
export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};

export const HostedCheckoutSuccess: Story = {
  args: {
    hostedCheckoutSuccess: {
      isUpgrade: false,
      licenseKey: "STIRLING-XXXX-XXXX-XXXX",
    },
  },
};

export const TeamPurchase: Story = {
  args: { combinedChoose: true, onContactSales: () => {} },
};

export const TeamAdjustment: Story = {
  args: { combinedChoose: true, currentLimit: 300, minimumSeats: 40 },
};