diff --git a/webapp/src/components/AutomationListV2/index.css b/webapp/src/components/AutomationListV2/Sidebar/index.css similarity index 100% rename from webapp/src/components/AutomationListV2/index.css rename to webapp/src/components/AutomationListV2/Sidebar/index.css diff --git a/webapp/src/components/AutomationListV2/index.stories.tsx b/webapp/src/components/AutomationListV2/Sidebar/index.stories.tsx similarity index 87% rename from webapp/src/components/AutomationListV2/index.stories.tsx rename to webapp/src/components/AutomationListV2/Sidebar/index.stories.tsx index 7852003..09bc1c7 100644 --- a/webapp/src/components/AutomationListV2/index.stories.tsx +++ b/webapp/src/components/AutomationListV2/Sidebar/index.stories.tsx @@ -1,17 +1,15 @@ import "styles/root.css"; import { ComponentMeta, ComponentStory } from "@storybook/react"; import { Page } from "components/Page"; -import { AutomationList } from "."; -import { createHAEntitiesState, useHAEntities } from "haService/HAEntities"; -import { makeTagDB } from "./TagDB"; -import { useConnectedApiService } from "apiService"; +import { AutomationListSidebar } from "."; +import { makeTagDB } from "../TagDB"; import { useMockHAEntities } from "haService/HAEntities.mock"; import { createMockAuto } from "utils/mocks"; import { useState } from "react"; export default { - title: "App/AutomationList", - component: AutomationList, + title: "App/AutomationList/Sidebar", + component: AutomationListSidebar, parameters: { actions: { argTypesRegex: "^on.*" } }, args: { title: "Example", @@ -22,12 +20,12 @@ export default { routine: "night time", }, }, -} as ComponentMeta; +} as ComponentMeta; -export const Loading: ComponentStory = (args) => { +export const Loading: ComponentStory = (args) => { return ( - = (args) => { ); }; -export const Mocked: ComponentStory = (args) => { +export const Mocked: ComponentStory = (args) => { const [mockAutos, setAutos] = useState([ createMockAuto({ room: "bedroom" }), createMockAuto({ room: "bathroom", type: "routine" }), @@ -85,7 +83,7 @@ export const Mocked: ComponentStory = (args) => { }); return ( - metadata)} diff --git a/webapp/src/components/AutomationListV2/index.tsx b/webapp/src/components/AutomationListV2/Sidebar/index.tsx similarity index 84% rename from webapp/src/components/AutomationListV2/index.tsx rename to webapp/src/components/AutomationListV2/Sidebar/index.tsx index 720d318..389e3a0 100644 --- a/webapp/src/components/AutomationListV2/index.tsx +++ b/webapp/src/components/AutomationListV2/Sidebar/index.tsx @@ -9,13 +9,13 @@ import { AutomationMetadata } from "types/automations"; import InputText from "components/Inputs/InputText"; import InputMultiSelect from "components/Inputs/InputMultiSelect"; -import { ListBoxGroup } from "./ListBoxGroup"; -import { consolidateAutomations, filterAutomations } from "./helpers"; -import { TagDB } from "./TagDB"; -import { convertGroupingToItems, makeGrouping } from "./automationGrouper"; -import { AutomationListAutoUpdatable } from "./types"; +import { ListBoxGroup } from "../ListBoxGroup"; +import { consolidateAutomations, filterAutomations } from "../helpers"; +import { TagDB } from "../TagDB"; +import { convertGroupingToItems, makeGrouping } from "../automationGrouper"; +import { AutomationListAutoUpdatable } from "../types"; -export type AutomationListProps = { +export type AutomationListSidebarProps = { configAutomationMetadatas: AutomationMetadata[]; tagsDB: TagDB; haEntites: HAEntitiesState; @@ -27,7 +27,7 @@ export type AutomationListProps = { ) => void; onAutomationDelete: (aid: string) => void; }; -export const AutomationList: FC = ({ +export const AutomationListSidebar: FC = ({ configAutomationMetadatas, tagsDB, haEntites,