fix keys
This commit is contained in:
@@ -361,10 +361,10 @@ export const CommandPalette = (): JSX.Element => {
|
|||||||
<CommandInput placeholder="Type a command or search..." />
|
<CommandInput placeholder="Type a command or search..." />
|
||||||
<CommandList>
|
<CommandList>
|
||||||
<CommandEmpty>No results found.</CommandEmpty>
|
<CommandEmpty>No results found.</CommandEmpty>
|
||||||
{groups.map((group) => (
|
{groups.map((group, index) => (
|
||||||
<CommandGroup heading={group.label}>
|
<CommandGroup key={index} heading={group.label}>
|
||||||
{group.commands.map((command) => (
|
{group.commands.map((command, index) => (
|
||||||
<>
|
<div key={index}>
|
||||||
<CommandItem
|
<CommandItem
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
command.action && command.action();
|
command.action && command.action();
|
||||||
@@ -375,14 +375,15 @@ export const CommandPalette = (): JSX.Element => {
|
|||||||
{command.label}
|
{command.label}
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
{command.subItems &&
|
{command.subItems &&
|
||||||
command.subItems.map((subItem) => (
|
command.subItems.map((subItem, index) => (
|
||||||
<SubItem
|
<SubItem
|
||||||
|
key={index}
|
||||||
label={subItem.label}
|
label={subItem.label}
|
||||||
icon={subItem.icon}
|
icon={subItem.icon}
|
||||||
action={subItem.action}
|
action={subItem.action}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</>
|
</div>
|
||||||
))}
|
))}
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -55,13 +55,17 @@ export const NewDeviceDialog = ({
|
|||||||
<Tabs defaultValue="HTTP">
|
<Tabs defaultValue="HTTP">
|
||||||
<TabsList>
|
<TabsList>
|
||||||
{tabs.map((tab) => (
|
{tabs.map((tab) => (
|
||||||
<TabsTrigger value={tab.label} disabled={tab.disabled}>
|
<TabsTrigger
|
||||||
|
key={tab.label}
|
||||||
|
value={tab.label}
|
||||||
|
disabled={tab.disabled}
|
||||||
|
>
|
||||||
{tab.label}
|
{tab.label}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
{tabs.map((tab) => (
|
{tabs.map((tab, index) => (
|
||||||
<TabsContent value={tab.label}>
|
<TabsContent key={index} value={tab.label}>
|
||||||
{tab.disabled ? (
|
{tab.disabled ? (
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||||
{tab.disabledMessage}
|
{tab.disabledMessage}
|
||||||
|
|||||||
@@ -92,14 +92,17 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
className="space-y-8 divide-y divide-gray-200"
|
className="space-y-8 divide-y divide-gray-200"
|
||||||
onChange={handleSubmit(onSubmit)}
|
onChange={handleSubmit(onSubmit)}
|
||||||
>
|
>
|
||||||
{fieldGroups.map((fieldGroup) => (
|
{fieldGroups.map((fieldGroup, index) => (
|
||||||
<div className="space-y-8 divide-y divide-gray-200 sm:space-y-5">
|
<div
|
||||||
|
key={index}
|
||||||
|
className="space-y-8 divide-y divide-gray-200 sm:space-y-5"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<H4 className="font-medium">{fieldGroup.label}</H4>
|
<H4 className="font-medium">{fieldGroup.label}</H4>
|
||||||
<Subtle>{fieldGroup.description}</Subtle>
|
<Subtle>{fieldGroup.description}</Subtle>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{fieldGroup.fields.map((field) => {
|
{fieldGroup.fields.map((field, index) => {
|
||||||
const fieldWrapperData: FieldWrapperProps = {
|
const fieldWrapperData: FieldWrapperProps = {
|
||||||
label: field.label,
|
label: field.label,
|
||||||
description: field.description,
|
description: field.description,
|
||||||
@@ -109,7 +112,7 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case "text":
|
case "text":
|
||||||
return (
|
return (
|
||||||
<FieldWrapper {...fieldWrapperData}>
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
<Input
|
<Input
|
||||||
disabled={fieldWrapperData.disabled}
|
disabled={fieldWrapperData.disabled}
|
||||||
{...register(field.name)}
|
{...register(field.name)}
|
||||||
@@ -118,7 +121,7 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
);
|
);
|
||||||
case "number":
|
case "number":
|
||||||
return (
|
return (
|
||||||
<FieldWrapper {...fieldWrapperData}>
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
<Input
|
<Input
|
||||||
type="number"
|
type="number"
|
||||||
disabled={fieldWrapperData.disabled}
|
disabled={fieldWrapperData.disabled}
|
||||||
@@ -128,7 +131,7 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
);
|
);
|
||||||
case "password":
|
case "password":
|
||||||
return (
|
return (
|
||||||
<FieldWrapper {...fieldWrapperData}>
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
<Input
|
<Input
|
||||||
type="password"
|
type="password"
|
||||||
disabled={fieldWrapperData.disabled}
|
disabled={fieldWrapperData.disabled}
|
||||||
@@ -138,7 +141,7 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
);
|
);
|
||||||
case "toggle":
|
case "toggle":
|
||||||
return (
|
return (
|
||||||
<FieldWrapper {...fieldWrapperData}>
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
<Controller
|
<Controller
|
||||||
name={field.name}
|
name={field.name}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -160,7 +163,7 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
return (
|
return (
|
||||||
<FieldWrapper {...fieldWrapperData}>
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
<Controller
|
<Controller
|
||||||
name={field.name}
|
name={field.name}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -198,7 +201,11 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
</FieldWrapper>
|
</FieldWrapper>
|
||||||
);
|
);
|
||||||
case "multiSelect":
|
case "multiSelect":
|
||||||
return <FieldWrapper {...fieldWrapperData}>tmp</FieldWrapper>;
|
return (
|
||||||
|
<FieldWrapper key={index} {...fieldWrapperData}>
|
||||||
|
tmp
|
||||||
|
</FieldWrapper>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ export const PageLayout = ({
|
|||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<span className="w-full text-lg font-medium">{title}</span>
|
<span className="w-full text-lg font-medium">{title}</span>
|
||||||
<div className="flex justify-end space-x-4">
|
<div className="flex justify-end space-x-4">
|
||||||
{actions?.map((action) => (
|
{actions?.map((action, index) => (
|
||||||
<button
|
<button
|
||||||
|
key={index}
|
||||||
className="transition-all hover:text-accent"
|
className="transition-all hover:text-accent"
|
||||||
onClick={action.onClick}
|
onClick={action.onClick}
|
||||||
>
|
>
|
||||||
@@ -76,9 +76,9 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SidebarSection label="Navigation">
|
<SidebarSection label="Navigation">
|
||||||
{pages.map((link) => (
|
{pages.map((link, index) => (
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
key={link.page}
|
key={index}
|
||||||
label={link.name}
|
label={link.name}
|
||||||
icon={link.icon}
|
icon={link.icon}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Sidebar } from "@app/components/Sidebar.js";
|
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 { cn } from "@app/core/utils/cn.js";
|
||||||
import { Channel } from "@components/PageComponents/Channel.js";
|
import { Channel } from "@components/PageComponents/Channel.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import { Sidebar } from "@app/components/Sidebar.js";
|
|||||||
import { SettingsIcon, BoxesIcon, SaveIcon } from "lucide-react";
|
import { SettingsIcon, BoxesIcon, SaveIcon } from "lucide-react";
|
||||||
import { DeviceConfig } from "@pages/Config/DeviceConfig.js";
|
import { DeviceConfig } from "@pages/Config/DeviceConfig.js";
|
||||||
import { ModuleConfig } from "@pages/Config/ModuleConfig.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 { SidebarSection } from "@app/components/UI/Sidebar/SidebarSection.js";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
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";
|
import { SidebarButton } from "@app/components/UI/Sidebar/sidebarButton.js";
|
||||||
|
|
||||||
export const ConfigPage = (): JSX.Element => {
|
export const ConfigPage = (): JSX.Element => {
|
||||||
|
|||||||
+2
-4
@@ -4,14 +4,12 @@ import { useAppStore } from "@core/stores/appStore.js";
|
|||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
import { Sidebar } from "@app/components/Sidebar.js";
|
import { Sidebar } from "@app/components/Sidebar.js";
|
||||||
import { PageLayout } from "@app/components/Topbar.js";
|
import { PageLayout } from "@app/components/PageLayout.js";
|
||||||
import {
|
import {
|
||||||
ZoomInIcon,
|
ZoomInIcon,
|
||||||
ZoomOutIcon,
|
ZoomOutIcon,
|
||||||
BoxSelectIcon,
|
BoxSelectIcon,
|
||||||
MapPinIcon,
|
MapPinIcon
|
||||||
EditIcon,
|
|
||||||
PlusIcon
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { bbox, lineString } from "@turf/turf";
|
import { bbox, lineString } from "@turf/turf";
|
||||||
import { SidebarSection } from "@app/components/UI/Sidebar/SidebarSection.js";
|
import { SidebarSection } from "@app/components/UI/Sidebar/SidebarSection.js";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Sidebar } from "@app/components/Sidebar.js";
|
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 { ChannelChat } from "@components/PageComponents/Messages/ChannelChat.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
|
|||||||
Reference in New Issue
Block a user