Skip to content

Commit 44d50d5

Browse files
update action button interface to match the new structure
1 parent 2b47659 commit 44d50d5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

frontend/src/components/ActionButton.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import React, { ReactNode } from 'react'
66
interface ActionButtonProps {
77
url?: string
88
onClick?: () => void
9+
onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement | HTMLButtonElement>
910
tooltipLabel?: string
1011
children: ReactNode
12+
className?: string
1113
}
1214

13-
const ActionButton: React.FC<ActionButtonProps> = ({ url, onClick, tooltipLabel, children }) => {
15+
const ActionButton: React.FC<ActionButtonProps> = ({ url, onClick, tooltipLabel, children, onKeyDown, className = '' }) => {
1416
const baseStyles =
1517
'flex items-center gap-2 px-2 py-2 rounded-md border border-[#1D7BD7] transition-all whitespace-nowrap justify-center bg-transparent text-blue-600 hover:bg-[#1D7BD7] hover:text-white dark:hover:text-white'
1618

@@ -20,18 +22,19 @@ const ActionButton: React.FC<ActionButtonProps> = ({ url, onClick, tooltipLabel,
2022
href={url}
2123
target="_blank"
2224
rel="noopener noreferrer"
23-
className={baseStyles}
25+
className={`${baseStyles} ${className}`}
2426
data-tooltip-id="button-tooltip"
2527
data-tooltip-content={tooltipLabel}
2628
onClick={onClick}
29+
onKeyDown={onKeyDown}
2730
aria-label={tooltipLabel}
2831
>
2932
{children}
3033
</Link>
3134
</TooltipWrapper>
3235
) : (
3336
<TooltipWrapper tooltipLabel={tooltipLabel}>
34-
<Button onPress={onClick} className={baseStyles} aria-label={tooltipLabel}>
37+
<Button onPress={onClick} onKeyDown={onKeyDown} className={`${baseStyles} ${className}`} aria-label={tooltipLabel}>
3538
{children}
3639
</Button>
3740
</TooltipWrapper>

0 commit comments

Comments
 (0)