mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
* Basics for rendering scenes as an embedded page * Render submenu in embedded scene * EmbeddedScene alternative for embedding within Grafana page
21 lines
493 B
TypeScript
21 lines
493 B
TypeScript
// Libraries
|
|
import React, { FC } from 'react';
|
|
|
|
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
|
|
|
|
import { getSceneByTitle } from './scenes';
|
|
|
|
export interface Props extends GrafanaRouteComponentProps<{ name: string }> {}
|
|
|
|
export const ScenePage: FC<Props> = (props) => {
|
|
const scene = getSceneByTitle(props.match.params.name, true);
|
|
|
|
if (!scene) {
|
|
return <h2>Scene not found</h2>;
|
|
}
|
|
|
|
return <scene.Component model={scene} />;
|
|
};
|
|
|
|
export default ScenePage;
|