cleanup: hasLink not needed

This commit is contained in:
Apoorv Mishra committed 2025-11-18 16:38:42 +05:30
1 parent 2d16470982
commit 28b6e4ba14
1 file changed
+1 -3
+1 -3
View File
@@ -10,7 +10,6 @@ import { ComponentProps } from "../types";
import { ResizeLeft, ResizeRight } from "./ResizeHandle";
import useDragResize from "./hooks/useDragResize";
import { useTranslation } from "react-i18next";
import some from "lodash/some";
import find from "lodash/find";
type Props = ComponentProps & {
@@ -71,7 +70,6 @@ const Image = (props: Props) => {
}, [node.attrs.width]);
const sanitizedSrc = sanitizeUrl(src);
const hasLink = some(node.attrs.marks ?? [], (mark) => mark.type === "link");
const imgLink =
find(node.attrs.marks ?? [], (mark) => mark.type === "link")?.attrs.href ??
"";
@@ -121,7 +119,7 @@ const Image = (props: Props) => {
<GlobeIcon />
</Button>
)}
{hasLink && !props.isEditable && (
{imgLink && !props.isEditable && (
<Button onClick={props.onZoomIn} aria-label={t("Zoom In")}>
<ZoomInIcon />
</Button>