mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-08-03 20:00:03 +02:00

Remove Proptypes from CloneProjectModal GitOrigin-RevId: 400f4c9de72eb1910a0ca067882a6358663303d3
40 lines
1 KiB
TypeScript
40 lines
1 KiB
TypeScript
import React from 'react'
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
import CloneProjectModal from './clone-project-modal'
|
|
|
|
const EditorCloneProjectModalWrapper = React.memo(
|
|
function EditorCloneProjectModalWrapper({
|
|
show,
|
|
handleHide,
|
|
openProject,
|
|
}: {
|
|
show: boolean
|
|
handleHide: () => void
|
|
openProject: ({ project_id }: { project_id: string }) => void
|
|
}) {
|
|
const {
|
|
_id: projectId,
|
|
name: projectName,
|
|
tags: projectTags,
|
|
} = useProjectContext()
|
|
|
|
if (!projectName) {
|
|
// wait for useProjectContext
|
|
return null
|
|
} else {
|
|
return (
|
|
<CloneProjectModal
|
|
handleHide={handleHide}
|
|
show={show}
|
|
handleAfterCloned={openProject}
|
|
projectId={projectId}
|
|
projectName={projectName}
|
|
projectTags={projectTags}
|
|
/>
|
|
)
|
|
}
|
|
}
|
|
)
|
|
|
|
export default withErrorBoundary(EditorCloneProjectModalWrapper)
|