"use client"; import React, { useEffect, useState, useRef } from "react"; import { Card, CardContent, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { CheckIcon, EllipsisVerticalIcon } from "@heroicons/react/20/solid"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { Button } from "@/components/ui/button"; import { PricingPageProps, PricingTierProps } from "@/types/pricing"; import { useCheckout } from "@/hooks/useCheckout"; import { PRICING_TIERS } from "@/utils/constants"; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, } from "./ui/dropdown-menu"; import { Info } from "lucide-react"; import Footer from "./footer"; import Link from "next/link"; import { useDownload } from "@/hooks/useDownload"; import DownloadFeedbackForm from "./ui/download-feedback-form"; import { useReleases } from "@/hooks/useReleases"; import { ReleaseInfo } from "@/types/releaseTypes"; import CTA from "./cta"; import VersionInfo from "./ui/version-info"; interface ExtendedPricingTierProps extends PricingTierProps { disabled?: boolean; windowsRelease: ReleaseInfo; macRelease: ReleaseInfo; linuxRelease: ReleaseInfo; } const PricingTier: React.FC = ({ title, price, description, features, buttonText, isFree = false, priceId, user, index, disabled, priceUnit = "/month", windowsRelease, macRelease, linuxRelease, }) => { const [detectedOS, setDetectedOS] = useState(null); useEffect(() => { const userAgent = window.navigator.userAgent; if (userAgent.indexOf("Win") !== -1) setDetectedOS("windows"); if (userAgent.indexOf("Mac") !== -1) setDetectedOS("darwin-arm64"); if (userAgent.indexOf("Linux") !== -1) setDetectedOS("linux"); }, []); const { handleCheckout, isSubmitting } = useCheckout(user); const { downloadLink, handleDownload, showFeedback, setShowFeedback, handleFeedbackSubmit, } = useDownload(); const dynamicVersions: Record = { Windows: windowsRelease, "Mac (M chip)": macRelease, "Mac (Intel)": macRelease, Linux: linuxRelease, }; const featureRowDescription = (feature: string) => { if (feature?.startsWith("custom-standard")) { return (
Monthly refill of $15 credits for market-leading AI models
); } else if (feature?.startsWith("free")) { return (
Use our free trial, your own API key, or local models
); } else if (feature?.startsWith("custom-enterprise")) { return (
Monthly refill of increased{" "} PearAI Credits for market-leading AI models
); } return feature; }; return (
{title} {!isFree ? (

{title === "Enterprise" ? "Purchase bulk at a discount" : `$${price}`} {title === "Enterprise" ? "" : `${priceUnit}`} {(title === "Enterprise" || "Maker") && ( EARLY BIRD )}

{title === "Intern" || title === "Maker" ? description : ""}

) : (

Free

Download with a free trial

)}
{features && (
    {features.map((feature, index) => (
  • ))}
)}
{index === 1 && (
Pricing Gradient
)} {isFree && (
setShowFeedback(false)} onSubmit={handleFeedbackSubmit} /> {/* */} {downloadLink !== undefined && (

Thanks for trying out PearAI! Your download should have started, if it hasn't, click{" "} here .

)}
handleDownload("windows")} > Windows handleDownload("darwin-arm64")} > MacOS (Silicon) handleDownload("intel-x64")} > MacOS (Intel) (window.location.href = "/blog/download-pearai-on-linux") } > Linux
)} {!isFree && ( <> {disabled ? ( ) : ( )} )}
); }; const PricingPage: React.FC = ({ user }) => { const { releases, isLoading } = useReleases(); return ( <>

PRICING

Make your next project today.

Be the early bird and get a discount{" "} forever. 20-30% off (forever)
{!isLoading && PRICING_TIERS.standard && PRICING_TIERS.enterprise && (
{[...PRICING_TIERS.standard, ...PRICING_TIERS.enterprise].map( (tier, index) => (
), )}
)}