refactor(monorepo): decouple api and webui into workspaces packages

This commit is contained in:
yiling
2026-06-01 23:35:00 +08:00
parent e3f4fa219e
commit 1f341c15d0
288 changed files with 18024 additions and 21178 deletions
+27
View File
@@ -0,0 +1,27 @@
import { useLayoutEffect, useState } from 'react'
type ScreenSize = {
width: number
height: number
}
export function useScreenSize(): ScreenSize {
const [size, setSize] = useState<ScreenSize>({
width: window.innerWidth,
height: window.innerHeight,
})
useLayoutEffect(() => {
function handleResize() {
setSize({
width: window.innerWidth,
height: window.innerHeight,
})
}
window.addEventListener('resize', handleResize)
return () => window.removeEventListener('resize', handleResize)
}, [])
return size
}