io zuordnung; signal liste mit eas; links; csv ausgabe
This commit is contained in:
1 parent
13bbd26ce5
commit
f769ff7cc0
20 files changed
+594
-115
No files matched your search
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { formatComponentName } from "@/lib/componentName";
|
||||
|
||||
import { useEffect, useState } from "react"
|
||||
import { Anlage } from "@/types/rk";
|
||||
@@ -21,6 +22,7 @@ import { Select } from "@/components/ui/select";
|
||||
|
||||
|
||||
interface Params {
|
||||
initialComponentId?: string;
|
||||
anlage: Anlage,
|
||||
unitIntial?: UnitResponse
|
||||
selectedGroup?: GroupResponse
|
||||
@@ -30,9 +32,9 @@ interface Params {
|
||||
debug?: boolean
|
||||
}
|
||||
|
||||
export const UnitCreateForm = ({ anlage, unitIntial, onDisplaySelectGroup, selectedGroup, componentTypes, componentDefaults, debug }: Params) => {
|
||||
export const UnitCreateForm = ({ anlage, unitIntial, onDisplaySelectGroup, selectedGroup, componentTypes, componentDefaults, debug, initialComponentId }: Params) => {
|
||||
const [id, setId] = useState<string>();
|
||||
const [selectedComponent, setSelectedComponent] = useState<ComponentResponse>();
|
||||
const [selectedComponent, setSelectedComponent] = useState<ComponentResponse | undefined>(() => unitIntial?.components.find((component) => component.id === initialComponentId));
|
||||
|
||||
|
||||
const { emptyUnit, unitType, setValue, unitData, string_to_UnitType } = useUnit({ unit: unitIntial });
|
||||
@@ -163,7 +165,7 @@ export const UnitCreateForm = ({ anlage, unitIntial, onDisplaySelectGroup, selec
|
||||
<List variant="transparent" border={"none"} divide={false} size={"sm"}>
|
||||
{componentNames.map((comp) => (
|
||||
<ListItem className="" key={comp.id}>
|
||||
<Button onClick={() => handlerAppendComponent(comp.id)} type="button" key={comp.id} variant={"select"} size={"xs"} >{comp.name}</Button>
|
||||
<Button onClick={() => handlerAppendComponent(comp.id)} type="button" key={comp.id} variant={"select"} size={"xs"} >{formatComponentName(comp)}</Button>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
@@ -189,10 +191,7 @@ export const UnitCreateForm = ({ anlage, unitIntial, onDisplaySelectGroup, selec
|
||||
</ListItemTitle>
|
||||
|
||||
<ListItemDescription>
|
||||
{c.prefix && c.prefix}
|
||||
{c.name}
|
||||
{c.postfix && c.postfix}
|
||||
{c.index && c.index > 0 ? c.index: ""}
|
||||
{formatComponentName(c)}
|
||||
</ListItemDescription>
|
||||
</ListItemContent>
|
||||
|
||||
@@ -277,4 +276,4 @@ export const UnitCreateForm = ({ anlage, unitIntial, onDisplaySelectGroup, selec
|
||||
)}
|
||||
|
||||
|
||||
*/
|
||||
*/
|
||||
Reference in new issue
Block a user