all work
This commit is contained in:
1 parent
3e79ddffcc
commit
019fa23758
2 files changed
+68
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { useState } from "react";
|
||||
import { AutomationAction } from "~/automations/types/actions";
|
||||
import { usePageTheme } from "~/styles/page";
|
||||
import { SequenceEditor } from ".";
|
||||
|
||||
export default {
|
||||
title: 'SequenceEditor',
|
||||
component: SequenceEditor,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
} as ComponentMeta<typeof SequenceEditor>;
|
||||
|
||||
|
||||
const Template: ComponentStory<typeof SequenceEditor> = ({node, ...args}) => {
|
||||
const {classes} = usePageTheme({});
|
||||
const [data, setData] = useState(node);
|
||||
return <div className={classes.page}>
|
||||
<SequenceEditor {...args}
|
||||
node={data}
|
||||
onUpdate={data => {
|
||||
setData(data)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
export const ServiceAction = Template.bind({})
|
||||
ServiceAction.args = {
|
||||
node: {
|
||||
$smType: 'action',
|
||||
action: 'service',
|
||||
action_data: {
|
||||
service: 'switch.toggle',
|
||||
data: {},
|
||||
target: {},
|
||||
}
|
||||
} as AutomationAction
|
||||
}
|
||||
Reference in new issue
Block a user