'use client' import dynamic from 'next/dynamic' import React, { useEffect, useRef, useState } from 'react' import { useProject, } from '../../context/Project/provider' import { MagnifyingGlassMinusIcon, MagnifyingGlassPlusIcon } from '@heroicons/react/24/outline' import LanguageSelect from '../workspace/LanguageSelect' const CanvasStage = dynamic(() => import('./CanvasStage'), { ssr: false, }) const zoomStep = 0.01 const maxZoomLevel = 4 const DocumentCanvas = () => { const { getSelectedDocument } = useProject() const selectedDocument = getSelectedDocument() const [zoomLevel, setZoomLevel] = useState(1) const [size, setSize] = useState({ width: 0, height: 0 }) const thisRef = useRef(null) const handleWindowResize = () => { const width = thisRef?.current?.clientWidth || 0 const height = thisRef?.current?.clientHeight || 0 setSize({ width, height }) } useEffect(() => { handleWindowResize() window.addEventListener('resize', handleWindowResize) return () => window.removeEventListener('resize', handleWindowResize) }, [thisRef?.current?.clientWidth, thisRef?.current?.clientHeight]) return

{selectedDocument?.name}

{ setZoomLevel(e.currentTarget.valueAsNumber) }} />
} export default DocumentCanvas