import React from 'react'; import tw from 'twin.macro'; import Can from '@/components/elements/Can'; import Button from '@/components/elements/Button'; import StopOrKillButton from '@/components/server/StopOrKillButton'; import { PowerAction } from '@/components/server/ServerConsole'; import { ServerContext } from '@/state/server'; const PowerControls = () => { const status = ServerContext.useStoreState(state => state.status.value); const instance = ServerContext.useStoreState(state => state.socket.instance); const sendPowerCommand = (command: PowerAction) => { instance && instance.send('set state', command); }; return (