mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
The dataroom carried its own plan catalog, feature grid and Stripe price-id mapper with no payment SDK behind them, so nothing there could take money. Plans and pricing now open pay.hanzo.ai, invoices and payment method open billing.hanzo.ai, both named once in lib/billing/hosted.ts. UpgradePlanModal keeps its name, props and children API across all 45 call sites; clickedPlan rides the analytics event and highlightItem no longer has an effect, since the hosted page owns the catalog.
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { Dispatch, SetStateAction } from "react";
|
|
|
|
import { PlanEnum } from "@/lib/billing/legacy/constants";
|
|
import Cookies from "js-cookie";
|
|
|
|
import X from "@/components/shared/icons/x";
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
import { UpgradePlanModal } from "./upgrade-plan-modal";
|
|
|
|
export default function ProBanner({
|
|
setShowProBanner,
|
|
}: {
|
|
setShowProBanner: Dispatch<SetStateAction<boolean | null>>;
|
|
}) {
|
|
const handleHideBanner = () => {
|
|
setShowProBanner(false);
|
|
Cookies.set("hideProBanner", "pro-banner", {
|
|
expires: 7,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<aside className="relative mb-2 flex w-full flex-col justify-center rounded-lg border border-gray-700 bg-background p-4 text-foreground">
|
|
<button
|
|
type="button"
|
|
onClick={handleHideBanner}
|
|
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
|
|
>
|
|
<X className="h-4 w-4" />
|
|
<span className="sr-only">Close</span>
|
|
</button>
|
|
<div className="flex space-x-2">
|
|
<span className="text-sm font-bold">Upgrade Hanzo Dataroom</span>
|
|
</div>
|
|
<p className="my-4 text-sm">
|
|
A paid plan adds custom branding, custom domains, data rooms and more
|
|
team members.
|
|
</p>
|
|
<div className="flex">
|
|
<UpgradePlanModal
|
|
clickedPlan={PlanEnum.Business}
|
|
trigger={"pro_banner"}
|
|
>
|
|
<Button type="button" className="grow">
|
|
See plans
|
|
</Button>
|
|
</UpgradePlanModal>
|
|
</div>
|
|
</aside>
|
|
);
|
|
}
|