i18n: removes useTranslate hook (#106556)

* i18n: removes useTranslate hook

* chore: fix duplicate imports

* chore: fix import sorting and hook dependencies
This commit is contained in:
Hugo Häggmark
2025-06-12 11:03:52 +02:00
committed by GitHub
parent e73530da09
commit 2b8c74de2e
1134 changed files with 1605 additions and 2663 deletions

View File

@ -2,7 +2,7 @@ import { FormEvent, ReactElement, useCallback } from 'react';
import { TextBoxVariableModel } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { Trans, useTranslate } from '@grafana/i18n';
import { Trans, t } from '@grafana/i18n';
import { VariableLegend } from '../../dashboard-scene/settings/variables/components/VariableLegend';
import { VariableTextField } from '../../dashboard-scene/settings/variables/components/VariableTextField';
@ -20,8 +20,6 @@ export function TextBoxVariableEditor({ onPropChange, variable: { query } }: Pro
[onPropChange]
);
const { t } = useTranslate();
const onChange = useCallback((e: FormEvent<HTMLInputElement>) => updateVariable(e, false), [updateVariable]);
const onBlur = useCallback((e: FormEvent<HTMLInputElement>) => updateVariable(e, true), [updateVariable]);