import {~~~} from '~~~'
const useEditor = (tb) => {
useEffect(() => {
if (!tb) return
tb.editor = new Editor()
tb.editor.setSaveLoadFn(
async () => {
return await getContent('models')
},
async (data) => {
const res = await uploadContent('models', data)
if (res) return res
}
)
tb.editor.setNotifier((msg, type) => {
activateSnackbar(msg, (["info", "warning", "danger"].includes(type)) ? type : undefined)
})
tb.editor.setEnabledStatus(true)
}, [tb])
return
}