feat: image resizer

This commit is contained in:
Ivan Rezchikov
2026-07-15 22:19:26 +03:00
parent e56157f562
commit 687fbaf3a6
7 changed files with 80 additions and 23 deletions
+2 -2
View File
@@ -141,10 +141,10 @@ function BlockRenderer({ block }: { block: Block }) {
<img
src={b.url}
alt={b.caption || "Image"}
style={imageWidth && imageWidth < 100 ? { width: `${imageWidth}%` } : undefined}
style={imageWidth ? { width: `min(${imageWidth}px, 100%)` } : undefined}
className={cn(
"h-auto rounded-md border object-contain",
imageWidth && imageWidth < 100 ? "" : "w-full md:w-auto md:max-w-200"
imageWidth ? "" : "w-full md:w-auto md:max-w-200"
)}
/>