Skip to content

Commit

Permalink
Move i18n label inside function
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Oct 1, 2024
1 parent c66d197 commit 4b6cb0d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export type AskAssistantButtonProps = (
onClick: () => void;
};

const AI_ASSISTANT_LABEL = i18n.translate('xpack.aiAssistant.aiAssistantLabel', {
defaultMessage: 'AI Assistant',
});

export function AskAssistantButton({
fill,
flush,
Expand All @@ -54,6 +50,10 @@ export function AskAssistantButton({
defaultMessage: 'Ask Assistant',
});

const aiAssistantLabel = i18n.translate('xpack.aiAssistant.aiAssistantLabel', {
defaultMessage: 'AI Assistant',
});

switch (variant) {
case 'basic':
return (
Expand Down Expand Up @@ -85,13 +85,13 @@ export function AskAssistantButton({
return (
<EuiToolTip
position="top"
title={AI_ASSISTANT_LABEL}
title={aiAssistantLabel}
content={i18n.translate('xpack.aiAssistant.askAssistantButton.popoverContent', {
defaultMessage: 'Get insights into your data with the Elastic Assistant',
})}
>
<EuiButtonIcon
aria-label={AI_ASSISTANT_LABEL}
aria-label={aiAssistantLabel}
data-test-subj="observabilityAiAssistantAskAssistantButtonButtonIcon"
display={fill ? 'fill' : 'base'}
iconType="sparkles"
Expand Down

0 comments on commit 4b6cb0d

Please sign in to comment.