1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-18 16:05:33 -04:00

more caching and error handling

This commit is contained in:
2025-03-24 11:45:48 -04:00
parent 8890c1d08d
commit d3250bd00e
18 changed files with 335 additions and 327 deletions

View File

@@ -12,6 +12,7 @@ const Image = ({ src, height, width, placeholder, className, ...rest }: ImagePro
const constrainWidth = (width?: number | `${number}`) => {
if (!width) return MAX_WIDTH;
// ensure that the image width is not greater than the global maximum width
return Math.min(typeof width === "string" ? parseInt(width, 10) : width, MAX_WIDTH);
};