diff --git a/public/app/features/dashboard-scene/panel-edit/LibraryVizPanelInfo.tsx b/public/app/features/dashboard-scene/panel-edit/LibraryVizPanelInfo.tsx new file mode 100644 index 00000000000..bd741ee48fd --- /dev/null +++ b/public/app/features/dashboard-scene/panel-edit/LibraryVizPanelInfo.tsx @@ -0,0 +1,58 @@ +import { css } from '@emotion/css'; +import React from 'react'; + +import { GrafanaTheme2, dateTimeFormat } from '@grafana/data'; +import { useStyles2 } from '@grafana/ui'; + +import { LibraryVizPanel } from '../scene/LibraryVizPanel'; + +interface Props { + libraryPanel: LibraryVizPanel; +} + +export const LibraryVizPanelInfo = ({ libraryPanel }: Props) => { + const styles = useStyles2(getStyles); + + const libraryPanelState = libraryPanel.useState(); + const tz = libraryPanelState.$timeRange?.getTimeZone(); + const meta = libraryPanelState._loadedPanel?.meta; + if (!meta) { + return null; + } + + return ( +
+ {'This update will affect '} + + {libraryPanel.state._loadedPanel?.meta?.connectedDashboards}{' '} + {libraryPanel.state._loadedPanel?.meta?.connectedDashboards === 1 ? 'dashboard' : 'dashboards'}. + + The following dashboards using the panel will be affected: +
+ } + placeholder="Search affected dashboards" + value={searchString} + onChange={(e) => setSearchString(e.currentTarget.value)} + /> + {dashState.loading ? ( +Loading connected dashboards...
+ ) : ( +| Dashboard name | +
|---|
| {dashName} | +