diff --git a/services/web/frontend/js/features/project-list/components/dropdown/actions-dropdown.tsx b/services/web/frontend/js/features/project-list/components/dropdown/actions-dropdown.tsx index a05e2f4156..b4f6055685 100644 --- a/services/web/frontend/js/features/project-list/components/dropdown/actions-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/dropdown/actions-dropdown.tsx @@ -21,8 +21,11 @@ type ActionButtonProps = { function CopyProjectButtonMenuItem({ project, onClick }: ActionButtonProps) { return ( - {text => ( - + {(text, handleOpenModal) => ( + handleOpenModal(onClick)} + className="projects-action-menu-item" + > {' '} {text} diff --git a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/copy-project-button.tsx b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/copy-project-button.tsx index 5d4b167dd2..e753848adb 100644 --- a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/copy-project-button.tsx +++ b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/copy-project-button.tsx @@ -13,9 +13,14 @@ import { import { useProjectTags } from '@/features/project-list/hooks/use-project-tags' import { isSmallDevice } from '../../../../../../infrastructure/event-tracking' +type HandleOpenModal = (fn?: () => void) => void + type CopyButtonProps = { project: Project - children: (text: string, handleOpenModal: () => void) => React.ReactElement + children: ( + text: string, + handleOpenModal: HandleOpenModal + ) => React.ReactElement } function CopyProjectButton({ project, children }: CopyButtonProps) { @@ -31,9 +36,13 @@ function CopyProjectButton({ project, children }: CopyButtonProps) { const isMounted = useIsMounted() const projectTags = useProjectTags(project.id) - const handleOpenModal = useCallback(() => { - setShowModal(true) - }, []) + const handleOpenModal = useCallback( + (onOpen?: Parameters[0]) => { + setShowModal(true) + onOpen?.() + }, + [] + ) const handleCloseModal = useCallback(() => { if (isMounted.current) { @@ -97,7 +106,7 @@ const CopyProjectButtonTooltip = memo(function CopyProjectButtonTooltip({