---
// src/components/MyImage.astro
import type { ImageMetadata } from 'astro';
import { Image } from 'astro:assets';
type Props = {
	src: string | ImageMetadata;
	alt: string;
};
const { src, alt } = Astro.props;
---
{
	typeof src === 'string' ? (
		<img class="custom-styles" src={src} alt={alt} />
	) : (
		<Image class="custom-styles" {src} {alt} />
	)
}
<style>
	.custom-styles {
		border: 1px solid red;
	}
</style>
