fix: logs view format

This commit is contained in:
jialin
2024-09-14 14:41:59 +08:00
parent 0317a370da
commit 05390743e0
13 changed files with 167 additions and 288 deletions
+13
View File
@@ -0,0 +1,13 @@
import useResizeObserver from '@react-hook/resize-observer';
import React from 'react';
export default function useSize(target: any) {
const [size, setSize] = React.useState();
React.useLayoutEffect(() => {
setSize(target.current.getBoundingClientRect());
}, [target]);
useResizeObserver(target, (entry: any) => setSize(entry?.contentRect));
return size;
}