wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {
  memo,
} from 'react'
import { useStore } from '../../store'
import { useOpenLink } from './hooks'
import LinkEditorComponent from './component'
 
type LinkEditorPluginProps = {
  containerElement: HTMLDivElement | null
}
const LinkEditorPlugin = ({
  containerElement,
}: LinkEditorPluginProps) => {
  useOpenLink()
  const linkAnchorElement = useStore(s => s.linkAnchorElement)
 
  if (!linkAnchorElement)
    return null
 
  return (
    <LinkEditorComponent containerElement={containerElement} />
  )
}
 
export default memo(LinkEditorPlugin)