diff --git a/src/components/CommandPalette.tsx b/src/components/CommandPalette.tsx index b53b1df8..b689981c 100644 --- a/src/components/CommandPalette.tsx +++ b/src/components/CommandPalette.tsx @@ -361,10 +361,10 @@ export const CommandPalette = (): JSX.Element => { No results found. - {groups.map((group) => ( - - {group.commands.map((command) => ( - <> + {groups.map((group, index) => ( + + {group.commands.map((command, index) => ( +
{ command.action && command.action(); @@ -375,14 +375,15 @@ export const CommandPalette = (): JSX.Element => { {command.label} {command.subItems && - command.subItems.map((subItem) => ( + command.subItems.map((subItem, index) => ( ))} - +
))}
))} diff --git a/src/components/Dialog/NewDevice.tsx b/src/components/Dialog/NewDevice.tsx index 8a25ef1b..3b302601 100644 --- a/src/components/Dialog/NewDevice.tsx +++ b/src/components/Dialog/NewDevice.tsx @@ -55,13 +55,17 @@ export const NewDeviceDialog = ({ {tabs.map((tab) => ( - + {tab.label} ))} - {tabs.map((tab) => ( - + {tabs.map((tab, index) => ( + {tab.disabled ? (

{tab.disabledMessage} diff --git a/src/components/DynamicForm.tsx b/src/components/DynamicForm.tsx index 65033afc..6276cec6 100644 --- a/src/components/DynamicForm.tsx +++ b/src/components/DynamicForm.tsx @@ -92,14 +92,17 @@ export function DynamicForm({ className="space-y-8 divide-y divide-gray-200" onChange={handleSubmit(onSubmit)} > - {fieldGroups.map((fieldGroup) => ( -

+ {fieldGroups.map((fieldGroup, index) => ( +

{fieldGroup.label}

{fieldGroup.description}
- {fieldGroup.fields.map((field) => { + {fieldGroup.fields.map((field, index) => { const fieldWrapperData: FieldWrapperProps = { label: field.label, description: field.description, @@ -109,7 +112,7 @@ export function DynamicForm({ switch (field.type) { case "text": return ( - + ({ ); case "number": return ( - + ({ ); case "password": return ( - + ({ ); case "toggle": return ( - + ({ ) : []; return ( - + ({ ); case "multiSelect": - return tmp; + return ( + + tmp + + ); } })}
diff --git a/src/components/Topbar.tsx b/src/components/PageLayout.tsx similarity index 93% rename from src/components/Topbar.tsx rename to src/components/PageLayout.tsx index a39291b8..e68ef8be 100644 --- a/src/components/Topbar.tsx +++ b/src/components/PageLayout.tsx @@ -24,8 +24,9 @@ export const PageLayout = ({
{title}
- {actions?.map((action) => ( + {actions?.map((action, index) => (
- {pages.map((link) => ( + {pages.map((link, index) => ( { diff --git a/src/pages/Channels.tsx b/src/pages/Channels.tsx index 96eaeba3..eb6d7d18 100644 --- a/src/pages/Channels.tsx +++ b/src/pages/Channels.tsx @@ -1,5 +1,5 @@ import { Sidebar } from "@app/components/Sidebar.js"; -import { PageLayout } from "@app/components/Topbar.js"; +import { PageLayout } from "@app/components/PageLayout.js"; import { cn } from "@app/core/utils/cn.js"; import { Channel } from "@components/PageComponents/Channel.js"; import { useDevice } from "@core/stores/deviceStore.js"; diff --git a/src/pages/Config/index.tsx b/src/pages/Config/index.tsx index 9332da0e..b40018b0 100644 --- a/src/pages/Config/index.tsx +++ b/src/pages/Config/index.tsx @@ -2,11 +2,10 @@ import { Sidebar } from "@app/components/Sidebar.js"; import { SettingsIcon, BoxesIcon, SaveIcon } from "lucide-react"; import { DeviceConfig } from "@pages/Config/DeviceConfig.js"; import { ModuleConfig } from "@pages/Config/ModuleConfig.js"; -import { PageLayout } from "@app/components/Topbar.js"; +import { PageLayout } from "@app/components/PageLayout.js"; import { SidebarSection } from "@app/components/UI/Sidebar/SidebarSection.js"; import { useState } from "react"; import { useDevice } from "@app/core/stores/deviceStore.js"; -import { Button } from "@app/components/UI/Button.js"; import { SidebarButton } from "@app/components/UI/Sidebar/sidebarButton.js"; export const ConfigPage = (): JSX.Element => { diff --git a/src/pages/Map.tsx b/src/pages/Map.tsx index 8cca4ee8..e7424906 100644 --- a/src/pages/Map.tsx +++ b/src/pages/Map.tsx @@ -4,14 +4,12 @@ import { useAppStore } from "@core/stores/appStore.js"; import { useDevice } from "@core/stores/deviceStore.js"; import { Hashicon } from "@emeraldpay/hashicon-react"; import { Sidebar } from "@app/components/Sidebar.js"; -import { PageLayout } from "@app/components/Topbar.js"; +import { PageLayout } from "@app/components/PageLayout.js"; import { ZoomInIcon, ZoomOutIcon, BoxSelectIcon, - MapPinIcon, - EditIcon, - PlusIcon + MapPinIcon } from "lucide-react"; import { bbox, lineString } from "@turf/turf"; import { SidebarSection } from "@app/components/UI/Sidebar/SidebarSection.js"; diff --git a/src/pages/Messages.tsx b/src/pages/Messages.tsx index d13b4a74..977fd269 100644 --- a/src/pages/Messages.tsx +++ b/src/pages/Messages.tsx @@ -1,5 +1,5 @@ import { Sidebar } from "@app/components/Sidebar.js"; -import { PageLayout } from "@app/components/Topbar.js"; +import { PageLayout } from "@app/components/PageLayout.js"; import { ChannelChat } from "@components/PageComponents/Messages/ChannelChat.js"; import { useDevice } from "@core/stores/deviceStore.js"; import { Hashicon } from "@emeraldpay/hashicon-react";