mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 07:15:26 +01:00
2cc179acc1
- Added searchParams based router for easier testing - Added more stories to the storybook
30 lines
640 B
JavaScript
30 lines
640 B
JavaScript
import React from 'react';
|
|
import {useActionState} from './helper';
|
|
import FieldSelect from '../src/components/FieldSelect';
|
|
import {Wrapper} from './ui';
|
|
import {withA11y} from '@storybook/addon-a11y';
|
|
|
|
export default {
|
|
title: 'FieldSelect',
|
|
component: FieldSelect,
|
|
decorators: [withA11y],
|
|
};
|
|
|
|
|
|
export const Basic = () => {
|
|
const options = [["FOO", "Foo"], ["BAR", "Bar"], ["BAZ", "Baz"]];
|
|
const [value, setValue] = useActionState("onChange", "FOO");
|
|
|
|
return (
|
|
<Wrapper>
|
|
<FieldSelect
|
|
label="Foobar"
|
|
options={options}
|
|
value={value}
|
|
onChange={setValue}
|
|
/>
|
|
</Wrapper>
|
|
);
|
|
};
|
|
|
|
|