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