Skip to content

Commit 0108035

Browse files
committed
Fix some typescript typing issues
1 parent 79571e1 commit 0108035

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

resources/scripts/components/server/ServerConsole.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ import { faMicrochip } from '@fortawesome/free-solid-svg-icons/faMicrochip';
1010
import { bytesToHuman } from '@/helpers';
1111
import Spinner from '@/components/elements/Spinner';
1212

13+
type PowerAction = 'start' | 'stop' | 'restart' | 'kill';
14+
1315
const GreyBox = styled.div`
1416
${tw`mt-4 shadow-md bg-neutral-700 rounded p-3 flex text-xs`}
1517
`;
1618

1719
const ChunkedConsole = lazy(() => import('@/components/server/Console'));
1820

19-
const StopOrKillButton = ({ onPress }: { onPress: (action: string) => void }) => {
21+
const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void }) => {
2022
const [ clicked, setClicked ] = useState(false);
2123
const status = ServerContext.useStoreState(state => state.status.value);
2224

@@ -60,7 +62,7 @@ export default () => {
6062
setCpu(stats.cpu_absolute);
6163
};
6264

63-
const sendPowerCommand = (command: 'start' | 'stop' | 'restart' | 'kill') => {
65+
const sendPowerCommand = (command: PowerAction) => {
6466
instance && instance.send('set state', command);
6567
};
6668

0 commit comments

Comments
 (0)