Web:Client:Pages:Home:InfoPanel:Body:Sub-Components:ItemTitle:ItemContextOptions Refactoring
This commit is contained in:
parent
bb83e986e3
commit
265bae4017
@ -58,22 +58,8 @@ const ItemContextOptions = ({
|
||||
|
||||
const options = contextHelper?.getItemContextOptions();
|
||||
|
||||
const withId = (options) => {
|
||||
if (Array.isArray(options)) {
|
||||
return options.map((option) => {
|
||||
if (option.items) {
|
||||
option.items = withId(option.items);
|
||||
}
|
||||
return option.key
|
||||
? { ...option, id: `info-option_${option.key}` }
|
||||
: option;
|
||||
});
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
const getData = () => {
|
||||
return withId(options);
|
||||
return options;
|
||||
};
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user