import { Tldraw, TldrawApp, TldrawProps, useFileSystem } from '@tldraw/tldraw' import { useAccountHandlers } from 'hooks/useAccountHandlers' import React, { FC } from 'react' import { exportToImage } from 'utils/export' import * as gtag from 'utils/gtag' declare const window: Window & { app: TldrawApp } interface EditorProps { id?: string isUser?: boolean isSponsor?: boolean } const Editor: FC> = ({ id = 'home', isUser = false, isSponsor = false, ...rest }) => { const handleMount = React.useCallback((app: TldrawApp) => { window.app = app }, []) // Send events to gtag as actions. const handlePersist = React.useCallback((_app: TldrawApp, reason?: string) => { gtag.event({ action: reason ?? '', category: 'editor', label: reason ?? 'persist', value: 0, }) }, []) const fileSystemEvents = useFileSystem() const { onSignIn, onSignOut } = useAccountHandlers() return (
) } export default Editor