Files
Shortumation/webapp/src/components/Inputs/InputTime.stories.tsx
T
2022-06-11 18:54:33 -04:00

35 lines
851 B
TypeScript

import { ComponentMeta, ComponentStory } from "@storybook/react";
import { Page } from "components/Page";
import { useState } from "react";
import { AutomationTime } from "types/automations/common";
import { InputTime } from "./InputTime";
export default {
title: 'Inputs/InputTime',
component: InputTime,
parameters: { actions: { argTypesRegex: '^on.*' } },
} as ComponentMeta<typeof InputTime>;
const Template: ComponentStory<typeof InputTime> = args => {
const [value, setValue] = useState<AutomationTime | undefined>(undefined);
return <Page>
<div style={{
padding: '1em'
}}>
<InputTime {...args} value={value} onChange={t => {
setValue(t)
args.onChange(t)
}} />
</div>
</Page>
}
export const SimpleText = Template.bind({})
SimpleText.args = {
label: "Time Stamp",
value: "10"
}