|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
import styled from '@emotion/styled';
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
+import {t} from 'sentry/locale';
|
|
|
+
|
|
|
import ActionButton from './button';
|
|
|
import ConfirmableAction from './confirmableAction';
|
|
|
|
|
@@ -27,11 +29,11 @@ type ConfirmableActionProps = React.ComponentProps<typeof ConfirmableAction>;
|
|
|
|
|
|
type CommonProps = Omit<
|
|
|
ConfirmableActionProps,
|
|
|
- 'onConfirm' | 'confirmText' | 'children' | 'stopPropagation' | 'priority'
|
|
|
+ 'onConfirm' | 'confirmText' | 'children' | 'stopPropagation' | 'priority' | 'children'
|
|
|
> & {
|
|
|
title: string;
|
|
|
+ children: React.ReactChild;
|
|
|
onAction?: () => void;
|
|
|
- children?: React.ReactNode;
|
|
|
disabled?: boolean;
|
|
|
className?: string;
|
|
|
shouldConfirm?: boolean;
|
|
@@ -41,7 +43,7 @@ type CommonProps = Omit<
|
|
|
|
|
|
type Props = CommonProps &
|
|
|
({type?: 'button'} & Partial<
|
|
|
- Omit<React.ComponentProps<typeof StyledActionButton>, 'as'>
|
|
|
+ Omit<React.ComponentProps<typeof StyledActionButton>, 'as' | 'children'>
|
|
|
>);
|
|
|
|
|
|
export default function ActionLink({
|
|
@@ -59,7 +61,7 @@ export default function ActionLink({
|
|
|
...props
|
|
|
}: Props) {
|
|
|
const actionCommonProps = {
|
|
|
- ['aria-label']: title,
|
|
|
+ ['aria-label']: typeof title === 'string' ? title : t('Actions'),
|
|
|
className: classNames(className, {disabled}),
|
|
|
onClick: disabled ? undefined : onAction,
|
|
|
disabled,
|