Files
Hugo Häggmark 119d5897ea i18n: imports use @grafana/i18n (#105177)
* i18n: everything should target @grafana/i18n

* wip

* chore: updates after PR feedback

* Trigger build

* Trigger build

* Trigger build

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: revert all flaky tests

* chore: some incorrect usages of useTranslate
2025-05-15 09:17:14 +02:00

25 lines
891 B
TypeScript

import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
import { Trans } from '@grafana/i18n';
import { locationService } from '@grafana/runtime';
import { Button } from '@grafana/ui';
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
import { DashboardInteractions } from 'app/features/dashboard-scene/utils/interactions';
import { shareDashboardType } from '../ShareModal/utils';
export const ShareButton = ({ dashboard }: { dashboard: DashboardModel }) => {
return (
<Button
data-testid={e2eSelectors.pages.Dashboard.DashNav.shareButton}
variant="primary"
size="sm"
onClick={() => {
DashboardInteractions.toolbarShareClick();
locationService.partial({ shareView: shareDashboardType.link });
}}
>
<Trans i18nKey="dashboard.toolbar.share-button">Share</Trans>
</Button>
);
};