diff --git a/src/components/icon/iconList.ts b/src/components/icon/iconList.ts index aa43493f5..2a5eb04b0 100644 --- a/src/components/icon/iconList.ts +++ b/src/components/icon/iconList.ts @@ -61,7 +61,7 @@ import WysiwygListOrdered from '../../assets/icons/wysiwyg-list-ordered.svg'; import WysiwygListUnordered from '../../assets/icons/wysiwyg-list-unordered.svg'; import { IconType } from './iconType'; -type IconComponent = React.FC>; +export type IconComponent = React.FC>; export const iconList: Record = { [IconType.ADD]: Add, diff --git a/src/components/link/link.stories.tsx b/src/components/link/link.stories.tsx index 5f5d95837..2fc464b45 100644 --- a/src/components/link/link.stories.tsx +++ b/src/components/link/link.stories.tsx @@ -41,7 +41,7 @@ export const Primary: Story = { variant: 'primary', }, render: ({ showIconRight, ...props }) => ( - + ), }; diff --git a/src/components/link/link.tsx b/src/components/link/link.tsx index b86f539e7..adccc03ed 100644 --- a/src/components/link/link.tsx +++ b/src/components/link/link.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import React from 'react'; -import { iconList } from '../icon/iconList'; +import { Icon } from '../icon'; import type { ILinkProps, LinkVariant } from './link.api'; export const variantToLabelClassNames: Record = { @@ -41,8 +41,6 @@ export const Link = React.forwardRef( disabled ? disabledStyle : variantToLabelClassNames[variant], 'test-focus', ); - const IconComponent = iconRight ? iconList[iconRight] : null; - const iconSize: React.CSSProperties = { height: iconHeight ? `${iconHeight}px` : 'auto', width: 'auto' }; const descriptionClassName = classNames('truncate', disabled ? disabledStyle : 'text-neutral-500'); return ( @@ -58,7 +56,7 @@ export const Link = React.forwardRef( >
{label} - {IconComponent && } + {iconRight && }
{description &&

{description}

}