- removed multi node

- updated tag updater
This commit is contained in:
ari committed 2022-07-01 14:28:18 -04:00
1 parent 72afaee719
commit a8229eb7bd
20 files changed
+337 -550

No files matched your search

@@ -6,45 +6,66 @@ import { Page } from "components/Page";
import { CookiesProvider } from "react-cookie";
export default {
title: 'App/AutomationList/Box',
title: "App/AutomationList/Box",
component: AutomationListBox,
parameters: { actions: { argTypesRegex: '^on.*' } },
args: {
}
parameters: { actions: { argTypesRegex: "^on.*" } },
args: {},
} as ComponentMeta<typeof AutomationListBox>;
const Template: ComponentStory<typeof AutomationListBox> = (args) => {
const [selected, setSelected] = useState(args.selected);
return (
<Page>
<CookiesProvider>
<AutomationListBox
{...args}
automations={args.automations}
selected={selected}
onSelectAutomation={(i) => {
setSelected(i);
args.onSelectAutomation(i);
}}
/>
</CookiesProvider>
</Page>
);
};
const Template: ComponentStory<typeof AutomationListBox> = args => {
const [selected, setSelected] = useState(args.selected)
return <Page>
<CookiesProvider>
<AutomationListBox {...args} automations={args.automations} selected={selected} onSelectAutomation={(i) => {
setSelected(i)
args.onSelectAutomation(i)
}} />
</CookiesProvider>
</Page>
}
export const EmptyStart = Template.bind({})
export const EmptyStart = Template.bind({});
EmptyStart.args = {
...EmptyStart.args,
automations: [],
}
};
export const FewAutos = Template.bind({})
export const FewAutos = Template.bind({});
FewAutos.args = {
...FewAutos.args,
automations: [
createMockAuto({ "Room": "Bathroom", "Type": "Lights", "NewDevice": "Yes", "Remote": "No", "Floor": "1" }),
createMockAuto({ "Room": "Bathroom", "Type": "Climate" }),
createMockAuto({ "Room": "Living Room", "Type": "Climate" }),
createMockAuto({ "Type": "Climate" }),
createMockAuto({ "Type": "Lights", "Routine": "Myself" }),
createMockAuto({ "Routine": "DNS", "Type": "SSL" }),
createMockAuto({ "Room": "Bedroom", "Type": "Lights", "Routine": "Baby" }),
createMockAuto({ "Room": "Office", "Type": "Lights" }),
createMockAuto({ "Room": "Office" }),
createMockAuto({
Room: "Bathroom",
Type: "Lights",
NewDevice: "Yes",
Remote: "No",
Floor: "1",
}),
createMockAuto({ Room: "Bathroom", Type: "Climate" }),
createMockAuto({ Room: "Living Room", Type: "Climate" }),
createMockAuto({ Type: "Climate" }),
createMockAuto({ Type: "Lights", Routine: "Myself" }),
createMockAuto({ Routine: "DNS", Type: "SSL" }),
createMockAuto({ Room: "Bedroom", Type: "Lights", Routine: "Baby" }),
createMockAuto({ Room: "Office", Type: "Lights" }),
createMockAuto({ Room: "Office" }),
createMockAuto(),
],
}
};
export const OneAuto = Template.bind({});
OneAuto.args = {
...OneAuto.args,
automations: [
createMockAuto({
Type: "Climate",
}),
],
};