full-project-search.tsx 610 B

12345678910111213141516171819202122
  1. import React, { FC, lazy, Suspense } from 'react'
  2. import { useLayoutContext } from '@/shared/context/layout-context'
  3. import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
  4. const FullProjectSearchUI = lazy(() => import('./full-project-search-ui'))
  5. const FullProjectSearch: FC = () => {
  6. const { projectSearchIsOpen } = useLayoutContext()
  7. const newEditor = useIsNewEditorEnabled()
  8. if (!projectSearchIsOpen && !newEditor) {
  9. return null
  10. }
  11. return (
  12. <Suspense fallback={null}>
  13. <FullProjectSearchUI />
  14. </Suspense>
  15. )
  16. }
  17. export default FullProjectSearch