mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
- 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
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { useEffect, useState } from "react";
|
|
|
|
import { DEFAULT_LINK_TYPE } from ".";
|
|
import LinkItem from "./link-item";
|
|
|
|
export default function AllowNotificationSection({
|
|
data,
|
|
setData,
|
|
}: {
|
|
data: DEFAULT_LINK_TYPE;
|
|
setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;
|
|
}) {
|
|
const { enableNotification } = data;
|
|
const [enabled, setEnabled] = useState<boolean>(true);
|
|
|
|
useEffect(() => {
|
|
setEnabled(enableNotification);
|
|
}, [enableNotification]);
|
|
|
|
const handleEnableNotification = () => {
|
|
const updatedEnableNotification = !enabled;
|
|
setData({ ...data, enableNotification: updatedEnableNotification });
|
|
setEnabled(updatedEnableNotification);
|
|
};
|
|
|
|
return (
|
|
<div className="pb-5">
|
|
<LinkItem
|
|
title="Receive email notification"
|
|
link="https://dataroom.hanzo.ai/help/article/link-settings"
|
|
enabled={enabled}
|
|
action={handleEnableNotification}
|
|
tooltipContent="Get notified via email when someone views your content."
|
|
/>
|
|
</div>
|
|
);
|
|
}
|