Files
grafana/public/app/features/dashboard/components/ShareModal/ShareLibraryPanel.tsx
Josh Hunt 5361efc225 I18n: Migrate to I18next (#55845)
* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
2022-10-06 16:34:04 +01:00

31 lines
904 B
TypeScript

import React, { useEffect } from 'react';
import { reportInteraction } from '@grafana/runtime/src';
import { Trans } from 'app/core/internationalization';
import { AddLibraryPanelContents } from 'app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal';
import { ShareModalTabProps } from './types';
interface Props extends ShareModalTabProps {
initialFolderId?: number;
}
export const ShareLibraryPanel = ({ panel, initialFolderId, onDismiss }: Props) => {
useEffect(() => {
reportInteraction('grafana_dashboards_library_panel_share_viewed');
}, []);
if (!panel) {
return null;
}
return (
<>
<p className="share-modal-info-text">
<Trans i18nKey="share-modal.library.info">Create library panel.</Trans>
</p>
<AddLibraryPanelContents panel={panel} initialFolderId={initialFolderId} onDismiss={onDismiss!} />
</>
);
};