diff --git a/src/elements/LinkButton.tsx b/src/elements/LinkButton.tsx index f03b2b952..9055fe5bc 100644 --- a/src/elements/LinkButton.tsx +++ b/src/elements/LinkButton.tsx @@ -11,6 +11,16 @@ export type LinkButtonProps = ButtonHTMLAttributes & { children?: string | ReactNode size: Size } +export function LinkButton({ children, Icon, size, ...props }: Readonly) { + return ( + + <> + {Icon && } + {isString(children) ?

{children}

: <>{children}} + +
+ ) +} const FONT_SIZE: Record = { [Size.LARGE]: '16px', @@ -23,14 +33,16 @@ const ICON_SIZE: Record = { [Size.SMALL]: 11 } -const StyledLinkButton = styled.button` +const StyledLinkButton = styled.button<{ + $size: Size +}>` align-items: flex-end; background: transparent; color: ${p => p.theme.color.slateGray}; cursor: ${p => (p.disabled ? 'none' : 'pointer')}; display: flex; flex-direction: row; - font-size: ${p => FONT_SIZE[p.size]}; + font-size: ${p => FONT_SIZE[p.$size]}; gap: 0.4rem; text-decoration: underline; @@ -58,16 +70,3 @@ const StyledLinkButton = styled.button` } } ` - -export function LinkButton({ children, Icon, ...props }: Readonly) { - return ( - - <> - {Icon && } - {isString(children) ?

{children}

: <>{children}} - -
- ) -} - -LinkButton.displayName = 'LinkButton'