mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 19:36:36 +08:00
19 lines
494 B
TypeScript
19 lines
494 B
TypeScript
import { createRoot } from 'react-dom/client'
|
|
|
|
import { ManageLibrariesDialogView } from './ManageLibrariesDialogView'
|
|
|
|
export function openManageLibrariesDialog(): Promise<void> {
|
|
return new Promise((resolve) => {
|
|
const host = document.createElement('div')
|
|
document.body.appendChild(host)
|
|
const root = createRoot(host)
|
|
|
|
const close = () => {
|
|
root.unmount()
|
|
host.remove()
|
|
resolve()
|
|
}
|
|
|
|
root.render(<ManageLibrariesDialogView onClose={close} />)
|
|
})
|
|
} |