--- import type { HTMLAttributes } from "astro/types"; interface Props extends HTMLAttributes<"a"> { includeExternalLinkIcon?: boolean; } import { Icon } from "astro-icon/components"; const { href, class: className, includeExternalLinkIcon = true, ...attrs } = Astro.props; const linkIsExternal: boolean = href !== undefined && href !== null ? href.toString().startsWith("http") : false; --- { includeExternalLinkIcon && linkIsExternal && ( ) }