diff --git a/ui/src/admin/components/chronograf/AllUsersTableRow.tsx b/ui/src/admin/components/chronograf/AllUsersTableRow.tsx index 479433eac0..6a946aeb5d 100644 --- a/ui/src/admin/components/chronograf/AllUsersTableRow.tsx +++ b/ui/src/admin/components/chronograf/AllUsersTableRow.tsx @@ -61,6 +61,7 @@ export default class AllUsersTableRow extends PureComponent { void addMenuItems?: Item[] addMenuChoose?: (item: Item) => void @@ -21,11 +22,19 @@ const Tags: SFC = ({ onDeleteTag, addMenuItems, addMenuChoose, + confirmText, }) => { return (
{tags.map(item => { - return + return ( + + ) })} {addMenuItems && addMenuItems.length && addMenuChoose ? ( @@ -35,38 +44,34 @@ const Tags: SFC = ({ } interface TagProps { + confirmText?: string item: Item onDelete: (item: Item) => void } @ErrorHandling class Tag extends PureComponent { + public static defaultProps: Partial = { + confirmText: 'Delete', + } + public render() { - const {item} = this.props + const {item, confirmText} = this.props return ( {item.text || item.name || item} ) } - private get confirmText(): string { - const {item} = this.props - if (item.name || item.text) { - return `Delete ${item.name || item.text}?` - } - - return 'Delete?' - } - private handleClickDelete = item => () => { this.props.onDelete(item) }