refactor: Update ActionsGroup component to improve readability and maintainability
parent
e2f724dd97
commit
b695cd6014
|
@ -27,25 +27,26 @@ const ActionsGroup = ({ machine, actions, addLog }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WakeComponent machine={machine} addLog={addLog} disabled={!canOperateMachines} />
|
<div style={{ display: "flex", flexDirection: "row", justifyContent: "flex-end" }}>
|
||||||
{mainActions.map(action => (
|
<WakeComponent machine={machine} addLog={addLog} disabled={!canOperateMachines} />
|
||||||
|
{mainActions.map(action => (
|
||||||
|
<ActionButton
|
||||||
|
key={`machine-item-${machine.machineId}-${action.code}`}
|
||||||
|
action={action}
|
||||||
|
machine={machine}
|
||||||
|
disabled={!canOperateMachines}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
<ActionButton
|
<ActionButton
|
||||||
key={`machine-item-${machine.machineId}-${action.code}`}
|
action={{
|
||||||
action={action}
|
code: "more",
|
||||||
|
effect: handleMenuOpen,
|
||||||
|
icon: MoreHoriz,
|
||||||
|
tooltip: t("Machine.Actions.More")
|
||||||
|
}}
|
||||||
machine={machine}
|
machine={machine}
|
||||||
disabled={!canOperateMachines}
|
|
||||||
/>
|
/>
|
||||||
))}
|
</div>
|
||||||
<ActionButton
|
|
||||||
action={{
|
|
||||||
code: "more",
|
|
||||||
effect: handleMenuOpen,
|
|
||||||
icon: MoreHoriz,
|
|
||||||
tooltip: t("Machine.Actions.More")
|
|
||||||
}}
|
|
||||||
machine={machine}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Menu
|
<Menu
|
||||||
id="secondary-actions-menu"
|
id="secondary-actions-menu"
|
||||||
anchorEl={menuAnchor}
|
anchorEl={menuAnchor}
|
||||||
|
|
Loading…
Reference in New Issue