tiagobento commented on code in PR #3033:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3033#discussion_r2029144758


##########
packages/dmn-editor/src/dataTypes/TypeRefSelector.tsx:
##########
@@ -152,41 +236,7 @@ export function TypeRefSelector({
         direction={direction}
         onWheelCapture={(e) => e.stopPropagation()} // Necessary so that 
Reactflow doesn't mess with this event.
       >
-        <SelectGroup label="Built-in" key="builtin" style={{ minWidth: "300px" 
}}>
-          {builtInFeelTypes.map((dt) => (
-            <SelectOption key={dt.name} value={dt.name}>
-              {dt.name}
-            </SelectOption>
-          ))}
-        </SelectGroup>
-        <SelectGroup label="Custom" key="custom" style={{ minWidth: "300px" }}>
-          {(customDataTypes.length > 0 &&
-            customDataTypes.map((dt) => (
-              <SelectOption key={dt.feelName} value={dt.feelName}>
-                {dt.feelName}
-                &nbsp;
-                <TypeRefLabel
-                  typeRef={dt.itemDefinition.typeRef?.__$$text}
-                  relativeToNamespace={dt.namespace}
-                  isCollection={dt.itemDefinition?.["@_isCollection"]}
-                />
-              </SelectOption>
-            ))) || <SelectOption key={"None"} value={"None"} isDisabled={true} 
/>}
-        </SelectGroup>
-        <SelectGroup label="External" key="external" style={{ minWidth: 
"300px" }}>
-          {(externalDataTypes.length > 0 &&
-            externalDataTypes.map((dt) => (
-              <SelectOption key={dt.feelName} value={dt.feelName}>
-                {dt.feelName}
-                &nbsp;
-                <TypeRefLabel
-                  typeRef={dt.itemDefinition.typeRef?.__$$text}
-                  relativeToNamespace={dt.namespace}
-                  isCollection={dt.itemDefinition?.["@_isCollection"]}
-                />
-              </SelectOption>
-            ))) || <SelectOption key={"None"} value={"None"} isDisabled={true} 
/>}
-        </SelectGroup>
+        {buildSelectGroups(builtInFeelTypes, customDataTypes, 
externalDataTypes)}

Review Comment:
   Can we extract this to a `useMemo` please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to