import type { ReactNode } from 'react'
import { createPortal } from 'react-dom'

const useRightBar = (element: ReactNode) => {
  const topnavPortal = document.getElementById('topnavPortal')

  return topnavPortal && createPortal(<>{element}</>, topnavPortal)
}

export default useRightBar
