The communications platform that puts data protection first.
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.
 
 
 
 
 
Rocket.Chat/client/views/admin/settings/inputs/SelectSettingInput.stories.js

68 lines
1.5 KiB

import { Field } from '@rocket.chat/fuselage';
import { action } from '@storybook/addon-actions';
import React from 'react';
import { SelectSettingInput } from './SelectSettingInput';
export default {
title: 'admin/settings/inputs/SelectSettingInput',
component: SelectSettingInput,
decorators: [
(storyFn) => <Field>{storyFn()}</Field>,
],
};
export const _default = () =>
<SelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={[
{ key: '1', i18nLabel: '1' },
{ key: '2', i18nLabel: '2' },
{ key: '3', i18nLabel: '3' },
]}
onChangeValue={action('changeValue')}
onChangeEditor={action('changeEditor')}
/>;
export const disabled = () =>
<SelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={[
{ key: '1', i18nLabel: '1' },
{ key: '2', i18nLabel: '2' },
{ key: '3', i18nLabel: '3' },
]}
disabled
/>;
export const withValue = () =>
<SelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
value='2'
values={[
{ key: '1', i18nLabel: '1' },
{ key: '2', i18nLabel: '2' },
{ key: '3', i18nLabel: '3' },
]}
/>;
export const withResetButton = () =>
<SelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={[
{ key: '1', i18nLabel: '1' },
{ key: '2', i18nLabel: '2' },
{ key: '3', i18nLabel: '3' },
]}
hasResetButton
onChangeValue={action('changeValue')}
onResetButtonClick={action('resetButtonClick')}
/>;