import { createContext, useContext } from 'react';
const NodeContext = /*#__PURE__*/createContext({});
const {
  Provider,
  Consumer
} = NodeContext;
function useNodeContext() {
  const {
    node
  } = useContext(NodeContext);
  if (!node) {
    return {
      inService: true,
      inDaemon: false
    };
  }
  return {
    ...node,
    inService: node.type === 'service',
    inDaemon: node.type === 'daemon'
  };
}
export { NodeContext, Provider as NodeProvider, Consumer as NodeConsumer, useNodeContext };