mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
108 files: README, marketing copy, page titles, meta tags, footer text, email templates, .env.example, UI strings. URLs swapped from papermark.com/papermark.io to dataroom.hanzo.ai. Internal identifiers left intact per repo policy: localStorage keys (papermark.email/papermark.name/last_papermark_login — changing them logs users out), type field names (papermarkUserId), internal helper symbols (PAPERMARK_HEADERS, PapermarkSparkle component, isPapermarkUrl helper), internal-only filenames. LLM.md retains 'Upstream: Papermark' attribution line. Per-locale .po translations regenerate from source on the next lingui-extract CI run. DB migrations untouched (append-only history; rewriting them breaks installed schemas). LICENSE stays AGPL-3.0.
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import { useEffect, useState } from "react";
|
|
|
|
import { DEFAULT_LINK_TYPE } from ".";
|
|
import LinkItem from "./link-item";
|
|
import { LinkUpgradeOptions } from "./link-options";
|
|
|
|
export function ProBannerSection({
|
|
data,
|
|
setData,
|
|
isAllowed,
|
|
handleUpgradeStateChange,
|
|
}: {
|
|
data: DEFAULT_LINK_TYPE;
|
|
setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;
|
|
isAllowed: boolean;
|
|
handleUpgradeStateChange: ({
|
|
state,
|
|
trigger,
|
|
plan,
|
|
highlightItem,
|
|
}: LinkUpgradeOptions) => void;
|
|
}) {
|
|
const { showBanner } = data;
|
|
const [enabled, setEnabled] = useState<boolean>(showBanner);
|
|
|
|
useEffect(() => {
|
|
setEnabled(showBanner);
|
|
}, [showBanner]);
|
|
|
|
const handleShowBanner = () => {
|
|
const updatedShowBanner = !enabled;
|
|
setData({ ...data, showBanner: updatedShowBanner });
|
|
setEnabled(updatedShowBanner);
|
|
};
|
|
|
|
return (
|
|
<div className="pb-5">
|
|
<LinkItem
|
|
title="Show Secured by Hanzo Dataroom"
|
|
tooltipContent="Display 'Secured by Hanzo Dataroom' branding on your shared documents"
|
|
link="https://dataroom.hanzo.ai/help/article/remove-branding"
|
|
enabled={enabled}
|
|
action={handleShowBanner}
|
|
isAllowed={isAllowed}
|
|
requiredPlan="pro"
|
|
upgradeAction={() =>
|
|
handleUpgradeStateChange({
|
|
state: true,
|
|
trigger: "link_sheet_hide_pro_banner_section",
|
|
plan: "Pro",
|
|
highlightItem: ["branding"],
|
|
})
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|