diff --git a/src/features/machines/components/Machine.js b/src/features/machines/components/Machine.js
index 18910ab..c742e30 100644
--- a/src/features/machines/components/Machine.js
+++ b/src/features/machines/components/Machine.js
@@ -5,13 +5,13 @@ import {
TableRow,
IconButton,
Collapse,
- Tooltip,
Menu
} from "@material-ui/core";
import { KeyboardArrowDown, KeyboardArrowUp } from "@material-ui/icons";
import { makeStyles } from "@material-ui/core/styles";
-import MachineLog from "./MachineLog";
-import WakeComponent from "./WakeComponent";
+import MachineLog from "./common/MachineLog";
+import WakeComponent from "./common/WakeComponent";
+import ActionButton from "./common/ActionButton";
import { useSensitiveInfo } from "../../../hooks";
const useRowStyles = makeStyles({
@@ -22,38 +22,6 @@ const useRowStyles = makeStyles({
}
});
-const ActionButton = React.forwardRef((props, _ref) => {
- const { action, machine } = props;
- return (
-
-
-
-
-
-
-
- );
-});
-
-ActionButton.propTypes = {
- machine: PropTypes.shape({
- machineId: PropTypes.number.isRequired
- }).isRequired,
- action: PropTypes.shape({
- code: PropTypes.string.isRequired,
- tooltip: PropTypes.string.isRequired,
- system: PropTypes.bool,
- effect: PropTypes.func.isRequired
- }).isRequired
-};
-
const Machine = ({
machine,
actions,
diff --git a/src/features/machines/components/common/ActionButton.js b/src/features/machines/components/common/ActionButton.js
new file mode 100644
index 0000000..3df8bca
--- /dev/null
+++ b/src/features/machines/components/common/ActionButton.js
@@ -0,0 +1,37 @@
+import React from "react";
+import PropTypes from "prop-types";
+import { IconButton, Tooltip } from "@material-ui/core";
+
+const ActionButton = React.forwardRef((props, _ref) => {
+ const { action, machine } = props;
+ return (
+
+
+
+
+
+
+
+ );
+});
+
+ActionButton.propTypes = {
+ machine: PropTypes.shape({
+ machineId: PropTypes.number.isRequired
+ }).isRequired,
+ action: PropTypes.shape({
+ code: PropTypes.string.isRequired,
+ tooltip: PropTypes.string.isRequired,
+ system: PropTypes.bool,
+ effect: PropTypes.func.isRequired
+ }).isRequired
+};
+
+export default ActionButton;
diff --git a/src/features/machines/components/MachineLog.js b/src/features/machines/components/common/MachineLog.js
similarity index 100%
rename from src/features/machines/components/MachineLog.js
rename to src/features/machines/components/common/MachineLog.js
diff --git a/src/features/machines/components/WakeComponent.js b/src/features/machines/components/common/WakeComponent.js
similarity index 95%
rename from src/features/machines/components/WakeComponent.js
rename to src/features/machines/components/common/WakeComponent.js
index 6fb923d..2794aec 100644
--- a/src/features/machines/components/WakeComponent.js
+++ b/src/features/machines/components/common/WakeComponent.js
@@ -3,9 +3,9 @@ import PropTypes from "prop-types";
import { IconButton, Tooltip } from "@material-ui/core";
import { PowerSettingsNew } from "@material-ui/icons";
import { useTranslation } from "react-i18next";
-import { useToast } from "../../../hooks";
-import { msToMinAndSec } from "../../../utils/time";
-import useApi from "../../../api";
+import { useToast } from "../../../../hooks";
+import { msToMinAndSec } from "../../../../utils/time";
+import useApi from "../../../../api";
const initialState = { on: false };
const defaultPingInterval = 1200000; //20 minutes