Skip to content

Commit bcf6442

Browse files
committed
Cast to any because apaprently lodash types aren't working
1 parent bf7435d commit bcf6442

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

src/components/GridItem/Sketch.astro

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
thumbnailDimensions,
66
type OpenProcessingCurationResponse,
77
} from "@/src/api/OpenProcessing";
8-
import isString from "lodash/isstring"
98
109
interface Props {
1110
item: OpenProcessingCurationResponse[number];
@@ -17,7 +16,7 @@ const { item, lazyLoad, scale = 1 } = Astro.props;
1716
const imgSrc = await getSketchThumbnailSource(item.visualID)
1817
const width = Math.min(thumbnailDimensions * scale, 1500);
1918
const height = Math.min(
20-
(isString(imgSrc) ? 1 : imgSrc.height / imgSrc.width) * thumbnailDimensions * scale,
19+
(typeof imgSrc === 'string' ? 1 : (imgSrc as any).height / (imgSrc as any).width) * thumbnailDimensions * scale,
2120
1000,
2221
);
2322
---
@@ -31,22 +30,13 @@ const height = Math.min(
3130
// the thumbnail looks like, and the OpenProcessing API
3231
// doesn't include that information
3332
}
34-
{isString(imgSrc) ? (
35-
<img
36-
src={imgSrc as any}
37-
alt="Screenshot of sketch"
38-
width={width}
39-
height={height}
40-
/>
41-
) : (
42-
<Image
43-
src={imgSrc}
44-
alt="Screenshot of sketch"
45-
width={width}
46-
height={height}
47-
loading={lazyLoad ? "lazy" : "eager"}
48-
/>
49-
)}
33+
<Image
34+
src={imgSrc as any}
35+
alt="Screenshot of sketch"
36+
width={width}
37+
height={height}
38+
loading={lazyLoad ? "lazy" : "eager"}
39+
/>
5040
<p
5141
class="text-body mt-xs text-wrap break-words break-keep group-hover:underline"
5242
>

0 commit comments

Comments
 (0)