Files
dataroom/components/links/link-sheet/index-file-section.tsx
zeekay 260fd6b8ce 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

56 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 default function IndexFileSection({
data,
setData,
isAllowed,
handleUpgradeStateChange,
}: {
data: DEFAULT_LINK_TYPE;
setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;
isAllowed: boolean;
handleUpgradeStateChange: ({
state,
trigger,
plan,
}: LinkUpgradeOptions) => void;
}) {
const { enableIndexFile } = data;
const [enabled, setEnabled] = useState<boolean>(false);
useEffect(() => {
setEnabled(enableIndexFile);
}, [enableIndexFile]);
const handleEnableIndexFile = () => {
const updatedEnableIndexFile = !enabled;
setData({ ...data, enableIndexFile: updatedEnableIndexFile });
setEnabled(updatedEnableIndexFile);
};
return (
<div className="pb-5">
<LinkItem
title="Enable index file generation"
enabled={enabled}
link="https://dataroom.hanzo.ai/help/article/link-settings"
action={handleEnableIndexFile}
isAllowed={isAllowed}
requiredPlan="data rooms plus"
upgradeAction={() =>
handleUpgradeStateChange({
state: true,
trigger: "link_sheet_index_file_section",
plan: "Data Rooms Plus",
})
}
tooltipContent="Allow visitors to generate an index file of all documents in the dataroom."
/>
</div>
);
}