Skip to content
Prev Previous commit
Next Next commit
chore: remove comments
  • Loading branch information
michalconsensys committed Sep 1, 2025
commit 308bf542175d6f2dcafce27e2932258682befb54
7 changes: 2 additions & 5 deletions src/components/elements/buttons/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,18 @@ const Button = forwardRef<HTMLElement, ButtonProps>(
textTransform !== 'none' && textTransform
)

// Conditionally build props based on element type
const isLinkElement = asValue === 'link' || asValue === 'a'
const isButtonElement = asValue === 'button'

const elementProps: Record<string, any> = {
ref: ref as React.Ref<any>,
'aria-label': ariaLabel,
onClick,
className: buttonClassNames,
style,
...rest
...rest,
}

// Add link-specific props only for link elements
if (isLinkElement) {
elementProps.href = href
if (external) {
Expand All @@ -142,7 +140,6 @@ const Button = forwardRef<HTMLElement, ButtonProps>(
}
}

// Add button-specific props only for button elements
if (isButtonElement) {
elementProps.disabled = disabled
if (buttonType) {
Expand Down
Loading