---
import type { LismProps } from '../types';
import getLismProps from '../../../dist/lib/getLismProps';
import getMediaProps from '../../../dist/components/getMediaProps';
import { Image } from 'astro:assets';

// Propsの定義
interface Props extends LismProps {
	// src?: string;
	// alt?: string;
	// width?: string | number;
	// height?: string | number;
}
const { as, exProps, tag, ...props } = Astro.props || {};

let JSX = as || tag || 'img';
if (JSX === 'AstroImage') {
	JSX = Image;
}
---

<JSX {...getLismProps(getMediaProps(props))} {...exProps}>
	<slot />
</JSX>
