--- import type { HTMLAttributes } from "astro/types" const sizes = { "xl": "h1", "lg": "h2", "md": "h3", "sm": "h4", "xs": "h5", "xxs": "h6" }; type Headers = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; interface Props extends HTMLAttributes { size: keyof typeof sizes; } const { size, ...attr } = Astro.props; const Element = sizes[size] as any; // Unfortunately gotta do this ---