mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 02:09:28 +08:00

* 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
25 lines
891 B
TypeScript
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>
|
|
);
|
|
};
|