diff --git a/web/src/beta/components/fields/PropertyFields/index.tsx b/web/src/beta/components/fields/PropertyFields/index.tsx index 33d7122f50..7be829a1c8 100644 --- a/web/src/beta/components/fields/PropertyFields/index.tsx +++ b/web/src/beta/components/fields/PropertyFields/index.tsx @@ -20,44 +20,39 @@ const PropertyFields: React.FC = ({ propertyId, item }) => { const isList = item && "items" in item; const value = !isList ? item.fields.find(f => f.id === sf.id)?.value : sf.defaultValue; - switch (sf.type) { - case "string": - // TODO: Can also be turned into a switch and infact bunch of props are common - return sf.ui === "color" ? ( - - ) : sf.ui === "selection" || sf.choices ? ( -

Selection or choices field

- ) : sf.ui === "buttons" ? ( -

Button radio field

- ) : ( - - ); - case "bool": - return ( - - ); - - default: - return

{sf.name} field

; - } + return sf.type === "string" ? ( + sf.ui === "color" ? ( + + ) : sf.ui === "selection" || sf.choices ? ( +

Selection or choices field

+ ) : sf.ui === "buttons" ? ( +

Button radio field

+ ) : ( + + ) + ) : sf.type == "bool" ? ( + + ) : ( +

{sf.name} field

+ ); })} );