8
8
9
9
import React from 'react' ;
10
10
import { EuiButtonGroup , htmlIdGenerator , EuiButtonGroupOptionProps } from '@elastic/eui' ;
11
- import { ComponentStrings } from '../../../i18n/components' ;
12
-
13
- const { QuickButtonGroup : strings } = ComponentStrings ;
11
+ import { i18n } from '@kbn/i18n' ;
14
12
13
+ const strings = {
14
+ QuickButtonGroup : {
15
+ getAriaButtonLabel : ( createType : string ) =>
16
+ i18n . translate ( 'presentationUtil.solutionToolbar.quickButton.ariaButtonLabel' , {
17
+ defaultMessage : `Create new {createType}` ,
18
+ values : {
19
+ createType,
20
+ } ,
21
+ } ) ,
22
+ getLegend : ( ) =>
23
+ i18n . translate ( 'presentationUtil.solutionToolbar.quickButton.legendLabel' , {
24
+ defaultMessage : 'Quick create' ,
25
+ } ) ,
26
+ } ,
27
+ } ;
15
28
export interface QuickButtonProps extends Pick < EuiButtonGroupOptionProps , 'iconType' > {
16
29
createType : string ;
17
30
onClick : ( ) => void ;
@@ -26,7 +39,7 @@ type Option = EuiButtonGroupOptionProps & Omit<QuickButtonProps, 'createType'>;
26
39
export const QuickButtonGroup = ( { buttons } : Props ) => {
27
40
const buttonGroupOptions : Option [ ] = buttons . map ( ( button : QuickButtonProps , index ) => {
28
41
const { createType : label , ...rest } = button ;
29
- const title = strings . getAriaButtonLabel ( label ) ;
42
+ const title = strings . QuickButtonGroup . getAriaButtonLabel ( label ) ;
30
43
31
44
return {
32
45
...rest ,
@@ -46,7 +59,7 @@ export const QuickButtonGroup = ({ buttons }: Props) => {
46
59
< EuiButtonGroup
47
60
buttonSize = "m"
48
61
className = "quickButtonGroup"
49
- legend = { strings . getLegend ( ) }
62
+ legend = { strings . QuickButtonGroup . getLegend ( ) }
50
63
options = { buttonGroupOptions }
51
64
onChange = { onChangeIconsMulti }
52
65
type = "multi"
0 commit comments