This repository has no description
Something went wrong. Try again.
627 B · 27 lines
TSX
at main
12345678910111213141516171819202122232425262728// src/components/lexical/PostImage.tsximport Image from 'next/image'
const widthClass: Record<string, string> = { inline: 'max-w-[24rem]', wide: 'max-w-[56rem]', full: '',}
export function PostImage({ src, alt, caption, widthHint = 'full',}: { src: string alt: string caption?: string widthHint?: 'full' | 'wide' | 'inline'}) { return ( <figure className={`my-8 ${widthClass[widthHint]}`}> <Image src={src} alt={alt} width={1600} height={900} className="h-auto w-full" /> {caption && <figcaption className="text-ink-3 text-[13px] mt-2">{caption}</figcaption>} </figure> )}