import React, { FunctionComponent, useEffect, useRef } from 'react'; import IconButtonElement from '../../elements/IconButtonElement'; const NewCollection: FunctionComponent = () => { const element = useRef(null); useEffect(() => { const btnNewCollection = element.current?.querySelector('.btnNewCollection') as HTMLButtonElement; if (btnNewCollection) { btnNewCollection.addEventListener('click', () => { import('../../components/collectionEditor/collectionEditor').then(({default: CollectionEditor}) => { const serverId = window.ApiClient.serverId(); const collectionEditor = new CollectionEditor(); collectionEditor.show({ items: [], serverId: serverId }); }); }); } }, []); return (
); }; export default NewCollection;