mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* Scenes: Progress on demo app * Argh * Fixing breadcrumbs * Added spacer * Conditional scene objects * Quick and dirty test for drilldown link via panel title * Changed the toggle * Add url state syncing for most links * Add url state syncing for most links * Fix instance in url params * Quick and dirty tabs on the handler page * fixing breadcrumbs * Hide footer * Updates * new table styles * Update table cell link styles * Added search box * Scene app demo: dynamic data link (#60398) * Dynamically build data links * Add field override tests * Updates * Updated * Updates * before nesting routing * Something is working * Caching and nested routes working * Simplify model * Use app components from grafana/scenes * Make the monitoring app work with section nav * Fixing * Update scenes * Remove unused route * Updates * remove file * Update scenes version and use new features * Remove semicolon * removed unused thing * Add refresh pickers --------- Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
25 lines
812 B
TypeScript
25 lines
812 B
TypeScript
import React from 'react';
|
|
|
|
import { SelectableValue } from '@grafana/data';
|
|
import { SceneComponentProps, SceneObjectBase, SceneObjectStatePlain } from '@grafana/scenes';
|
|
import { RadioButtonGroup } from '@grafana/ui';
|
|
|
|
export interface SceneRadioToggleState extends SceneObjectStatePlain {
|
|
options: Array<SelectableValue<string>>;
|
|
value: string;
|
|
onChange: (value: string) => void;
|
|
}
|
|
|
|
export class SceneRadioToggle extends SceneObjectBase<SceneRadioToggleState> {
|
|
public onChange = (value: string) => {
|
|
this.setState({ value });
|
|
this.state.onChange(value);
|
|
};
|
|
|
|
public static Component = ({ model }: SceneComponentProps<SceneRadioToggle>) => {
|
|
const { options, value } = model.useState();
|
|
|
|
return <RadioButtonGroup options={options} value={value} onChange={model.onChange} />;
|
|
};
|
|
}
|