diff --git a/app/components/DocumentExplorer/DocumentCopy.tsx b/app/components/DocumentExplorer/DocumentCopy.tsx index 8df50c05cd..ed2839d148 100644 --- a/app/components/DocumentExplorer/DocumentCopy.tsx +++ b/app/components/DocumentExplorer/DocumentCopy.tsx @@ -9,6 +9,7 @@ import Button from "~/components/Button"; import Switch from "~/components/Switch"; import Text from "~/components/Text"; import useCollectionTrees from "~/hooks/useCollectionTrees"; +import useCurrentTeam from "~/hooks/useCurrentTeam"; import useStores from "~/hooks/useStores"; import { FlexContainer, Footer } from "./Components"; import DocumentExplorer from "./DocumentExplorer"; @@ -22,10 +23,12 @@ type Props = { function DocumentCopy({ document, onSubmit }: Props) { const { t } = useTranslation(); const { policies } = useStores(); + const team = useCurrentTeam(); const collectionTrees = useCollectionTrees(); const [publish, setPublish] = React.useState(!!document.publishedAt); const [copying, setCopying] = React.useState(false); const [recursive, setRecursive] = React.useState(true); + const [comments, setComments] = React.useState(false); const [selectedPath, selectPath] = React.useState( null ); @@ -51,6 +54,7 @@ function DocumentCopy({ document, onSubmit }: Props) { const result = await document.duplicate({ publish, recursive, + comments: team.commentingEnabled && comments, title: document.title, collectionId: path.collectionId, ...(path.type === "document" ? { parentDocumentId: path.id } : {}), @@ -96,6 +100,17 @@ function DocumentCopy({ document, onSubmit }: Props) { /> )} + {team.commentingEnabled && ( + + + + )}