2021-11-17 18:32:57 +00:00
|
|
|
import { Meta, Story } from '@storybook/react';
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
2021-12-20 17:21:19 +00:00
|
|
|
import { Input } from './Input';
|
2021-11-17 18:32:57 +00:00
|
|
|
|
|
|
|
export default {
|
2021-12-20 17:21:19 +00:00
|
|
|
title: 'Components/Form/Input',
|
2021-11-17 18:32:57 +00:00
|
|
|
args: {
|
|
|
|
disabled: false,
|
|
|
|
},
|
|
|
|
} as Meta;
|
|
|
|
|
|
|
|
interface Args {
|
|
|
|
disabled?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function TextField({ disabled }: Args) {
|
|
|
|
const [value, setValue] = useState('');
|
2021-12-20 17:21:19 +00:00
|
|
|
return (
|
|
|
|
<Input
|
|
|
|
type="text"
|
|
|
|
value={value}
|
|
|
|
onChange={(e) => setValue(e.target.value)}
|
|
|
|
disabled={disabled}
|
2024-04-11 00:11:38 +00:00
|
|
|
data-cy="docker-logging-options-input"
|
2021-12-20 17:21:19 +00:00
|
|
|
/>
|
|
|
|
);
|
2021-11-17 18:32:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const DisabledTextField: Story<Args> = TextField.bind({});
|
|
|
|
DisabledTextField.args = {
|
|
|
|
disabled: true,
|
|
|
|
};
|