mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* First baby steps * First baby steps * No progress really * Updates * no progress * refactoring * Progress on sub menu and value selectors * Some more tweaks * Lots of progress * Progress * Updates * Progress * Tweaks * Updates * Updates to variable system * Cleaner tests * Update * Some cleanup * correct test name * Renames and moves * prop rename * Fixed scene template interpolator * More tests for SceneObjectBase and fixed issue in EventBus * Updates * More tweaks * More refinements * Fixed test * Added test to EventBus * Clone all scene object arrays * Simplify * tried to merge issue * Update * added more comments to interface * temp progress * Trying to simplify things, but struggling a bit * Updated * Tweaks * Progress on fixing the select componenet and typing, and sharing code in a base class * Updated * Multi select * Simpler loading state * Update * removed failOnConsole * Removed old funcs * Moved logic from update manage to MultiValueVariable * Added tests for MultiValueVariable logic * Made value a more abstract concept to support object values * renamed func to getValueText * Refactored and moved logic to VariableSet * Added test for deactivation and query cancelling * Tweaks * Fixed lint issues
23 lines
647 B
TypeScript
23 lines
647 B
TypeScript
import React from 'react';
|
|
|
|
import { SceneObjectBase } from '../core/SceneObjectBase';
|
|
import { SceneLayoutState, SceneComponentProps } from '../core/types';
|
|
|
|
interface SceneSubMenuState extends SceneLayoutState {}
|
|
|
|
export class SceneSubMenu extends SceneObjectBase<SceneSubMenuState> {
|
|
public static Component = SceneSubMenuRenderer;
|
|
}
|
|
|
|
function SceneSubMenuRenderer({ model }: SceneComponentProps<SceneSubMenu>) {
|
|
const { children } = model.useState();
|
|
|
|
return (
|
|
<div style={{ display: 'flex', gap: '16px' }}>
|
|
{children.map((child) => (
|
|
<child.Component key={child.state.key} model={child} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|