grafana/public/app/features/scenes/apps/SceneSearchBox.tsx
Torkel Ödegaard 5c9898a860
Scenes: SceneApp example in core (#64686)
* 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>
2023-03-20 11:15:42 +01:00

21 lines
679 B
TypeScript

import React from 'react';
import { SceneComponentProps, SceneObjectStatePlain, SceneObjectBase } from '@grafana/scenes';
import { Input } from '@grafana/ui';
export interface SceneSearchBoxState extends SceneObjectStatePlain {
value: string;
}
export class SceneSearchBox extends SceneObjectBase<SceneSearchBoxState> {
public onChange = (evt: React.FormEvent<HTMLInputElement>) => {
this.setState({ value: evt.currentTarget.value });
};
public static Component = ({ model }: SceneComponentProps<SceneSearchBox>) => {
const { value } = model.useState();
return <Input width={25} placeholder="Search..." value={value} onChange={model.onChange} />;
};
}