Files
dataroom/components/links/link-sheet/screenshot-protection-section.tsx
zeekay 130e86ef81 Rebrand from Papermark to Hanzo Dataroom
- Replace all Papermark branding with Hanzo Dataroom
- Update metadata, titles, descriptions, OG tags
- Update email templates footer and branding
- Replace papermark.io/com URLs with dataroom.hanzo.ai
- Update powered-by component
- Update x-powered-by header
- Update legal references to Hanzo AI, Inc.
- Update social handles to @hanzoai
- Update README, CLA, LICENSE, SECURITY docs
2026-03-01 19:02:19 -08:00

61 lines
1.6 KiB
TypeScript

import { useEffect, useState } from "react";
import { DEFAULT_LINK_TYPE } from ".";
import LinkItem from "./link-item";
import { LinkUpgradeOptions } from "./link-options";
export default function ScreenshotProtectionSection({
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 { enableScreenshotProtection } = data;
const [enabled, setEnabled] = useState<boolean>(true);
useEffect(() => {
setEnabled(enableScreenshotProtection);
}, [enableScreenshotProtection]);
const handleEnableScreenshotProtection = () => {
const updatedEnableScreenshotProtection = !enabled;
setData({
...data,
enableScreenshotProtection: updatedEnableScreenshotProtection,
});
setEnabled(updatedEnableScreenshotProtection);
};
return (
<div className="pb-5">
<LinkItem
title="Enable screenshot protection"
tooltipContent="Prevent users from taking screenshots of your content."
link="https://dataroom.hanzo.ai/screenshot-protection"
enabled={enabled}
action={handleEnableScreenshotProtection}
isAllowed={isAllowed}
requiredPlan="business"
upgradeAction={() =>
handleUpgradeStateChange({
state: true,
trigger: "link_sheet_screenshot_protection_section",
plan: "Business",
highlightItem: ["screenshot"],
})
}
/>
</div>
);
}