feat: image resizer
This commit is contained in:
@@ -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"
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user