--- import Icon from "@core-elements/icon/Icon.astro"; const { text, iconName, iconPosition = "before", hideText = false, variant = "primary", size = "md", link, element = "a", class: className, ...htmlAttributes } = Astro.props; const Tag = element as any; const tagProps: Record = Tag === "a" && link ? { href: link } : Tag === "button" ? { type: "button" } : {}; if (hideText) { tagProps["aria-label"] = htmlAttributes["aria-label"] || text; delete htmlAttributes["aria-label"]; } const hasText = text?.trim().length > 0; const hasSlotContent = Astro.slots.has("default"); const hasIcon = iconName?.trim().length > 0; if (!hasText && !hasSlotContent && !hasIcon) return; --- {!hideText && ( {text} )}