import React, { useEffect, useState } from 'react'; import AdminBox from '@/components/admin/AdminBox'; import tw from 'twin.macro'; import { faCode, faDragon } from '@fortawesome/free-solid-svg-icons'; import getNodeConfiguration from '@/api/admin/nodes/getNodeConfiguration'; import { Context } from '@/components/admin/nodes/NodeRouter'; import CopyOnClick from '@/components/elements/CopyOnClick'; import { ApplicationStore } from '@/state'; import { Actions, useStoreActions } from 'easy-peasy'; export default () => { const { clearFlashes, clearAndAddHttpError } = useStoreActions((actions: Actions) => actions.flashes); const [ configuration, setConfiguration ] = useState(''); const node = Context.useStoreState(state => state.node); if (node === undefined) { return ( <> ); } useEffect(() => { clearFlashes('node'); getNodeConfiguration(node.id) .then((configuration) => setConfiguration(configuration)) .catch(error => { console.error(error); clearAndAddHttpError({ key: 'node', error }); }); }, []); return ( <>
                        {configuration}
                    
Never™ ); };