The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.story.tsx

32 lines
1.0 KiB

import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { UseState } from '../../utils/storybook/UseState';
import { RefreshPicker } from './RefreshPicker';
const RefreshSelectStories = storiesOf('Pickers and Editors/RefreshPicker', module);
RefreshSelectStories.addDecorator(withCenteredStory);
RefreshSelectStories.add('default', () => {
return (
<UseState initialState={'1h'}>
{(value, updateValue) => {
return (
<RefreshPicker
tooltip="Hello world"
value={value}
intervals={['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d']}
onIntervalChanged={interval => {
action('onIntervalChanged fired')(interval);
}}
onRefresh={() => {
action('onRefresh fired')();
}}
/>
);
}}
</UseState>
);
});