fix: ts error
This commit is contained in:
parent
a0f0b4ff9e
commit
72d6f97024
app/components
|
@ -48,14 +48,12 @@ export function HTMLPreview(props: {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const height = useMemo(() => {
|
const height = useMemo(() => {
|
||||||
const parentHeight = props.height || 600;
|
if (!props.autoHeight) return props.height || 600;
|
||||||
if (props.autoHeight !== false) {
|
if (typeof props.height === "string") {
|
||||||
return iframeHeight + 40 > parentHeight
|
return props.height;
|
||||||
? parentHeight
|
|
||||||
: iframeHeight + 40;
|
|
||||||
} else {
|
|
||||||
return parentHeight;
|
|
||||||
}
|
}
|
||||||
|
const parentHeight = props.height || 600;
|
||||||
|
return iframeHeight + 40 > parentHeight ? parentHeight : iframeHeight + 40;
|
||||||
}, [props.autoHeight, props.height, iframeHeight]);
|
}, [props.autoHeight, props.height, iframeHeight]);
|
||||||
|
|
||||||
const srcDoc = useMemo(() => {
|
const srcDoc = useMemo(() => {
|
||||||
|
|
Loading…
Reference in New Issue