aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/fixtures/mdx-images/src/components/MyImage.astro
blob: 3cb699e3ab6813db41b17317ce8a3071850750e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
import { Image } from 'astro:assets';
import type { ImageMetadata } from 'astro';

type Props = {
	src: string | ImageMetadata;
	alt: string;
};

const { src, alt } = Astro.props;
---

{
	typeof src === 'string' ? (
		<img data-my-image src={src} alt={alt} />
	) : (
		<Image data-my-image {src} {alt} />
	)
}

<style>
	[data-my-image] {
		border: 1px solid red;
	}
</style>