22
33import { useMemo , useState } from "react" ;
44import { observer } from "mobx-react" ;
5+ import { useParams } from "next/navigation" ;
56import {
67 ArchiveRestoreIcon ,
78 Copy ,
@@ -28,8 +29,8 @@ import { cn } from "@/helpers/common.helper";
2829import { usePageOperations } from "@/hooks/use-page-operations" ;
2930// plane web components
3031import { MovePageModal } from "@/plane-web/components/pages" ;
31- // plane web constants
32- import { ENABLE_MOVE_PAGE } from "@/plane-web/constants " ;
32+ // plane web hooks
33+ import { usePageFlag } from "@/plane-web/hooks/use-page-flag " ;
3334// store types
3435import { TPageInstance } from "@/store/pages/base-page" ;
3536
@@ -60,6 +61,12 @@ export const PageActions: React.FC<Props> = observer((props) => {
6061 // states
6162 const [ deletePageModal , setDeletePageModal ] = useState ( false ) ;
6263 const [ movePageModal , setMovePageModal ] = useState ( false ) ;
64+ // params
65+ const { workspaceSlug } = useParams ( ) ;
66+ // page flag
67+ const { isMovePageEnabled } = usePageFlag ( {
68+ workspaceSlug : workspaceSlug ?. toString ( ) ?? "" ,
69+ } ) ;
6370 // page operations
6471 const { pageOperations } = usePageOperations ( {
6572 editorRef,
@@ -134,7 +141,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
134141 action : ( ) => setMovePageModal ( true ) ,
135142 title : "Move" ,
136143 icon : FileOutput ,
137- shouldRender : canCurrentUserMovePage && ENABLE_MOVE_PAGE ,
144+ shouldRender : canCurrentUserMovePage && isMovePageEnabled ,
138145 } ,
139146 ] ;
140147 if ( extraOptions ) {
@@ -146,6 +153,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
146153 archived_at ,
147154 extraOptions ,
148155 is_locked ,
156+ isMovePageEnabled ,
149157 canCurrentUserArchivePage ,
150158 canCurrentUserChangeAccess ,
151159 canCurrentUserDeletePage ,
0 commit comments