17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
import { cn } from '@/lib/utils';
|
|
import type { Experimental_GeneratedImage } from 'ai';
|
|
|
|
export type ImageProps = Experimental_GeneratedImage & {
|
|
className?: string;
|
|
alt?: string;
|
|
};
|
|
|
|
export const Image = ({ base64, mediaType, ...props }: ImageProps) => (
|
|
<img
|
|
{...props}
|
|
alt={props.alt}
|
|
className={cn('h-auto max-w-full overflow-hidden rounded-md', props.className)}
|
|
src={`data:${mediaType};base64,${base64}`}
|
|
/>
|
|
);
|