mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 20:54:29 +08:00
31 lines
883 B
TypeScript
31 lines
883 B
TypeScript
import { Trans } from '@lingui/macro';
|
|
import React, { useEffect } from 'react';
|
|
|
|
import { reportInteraction } from '@grafana/runtime/src';
|
|
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 id="share-modal.library.info">Create library panel.</Trans>
|
|
</p>
|
|
<AddLibraryPanelContents panel={panel} initialFolderId={initialFolderId} onDismiss={onDismiss!} />
|
|
</>
|
|
);
|
|
};
|