hunk.code_window:                 <FormControl
                     inputId="edge_enableOpenAMT"
                     label="Enable OpenAMT"
                     errors={errors.enabled}
                   >
                     <Switch
                       id="edge_enableOpenAMT"
                       name="edge_enableOpenAMT"
                       className="space-right"
  
hunk.labels: keep keep keep add keep keep keep keep keep
hunk.after_edit:                   size="small"
  
hunk.file_path: app/portainer/settings/edge-compute/SettingsOpenAMT/SettingsOpenAMT.tsx
hunk.type: add
file: import { useMutation } from 'react-query';
  import { useEffect } from 'react';
  
  import { generateKey } from '@/portainer/environments/environment.service/edge';
  import { useSettings } from '@/portainer/settings/queries';
  import { EdgeScriptForm } from '@/react/edge/components/EdgeScriptForm';
  import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts';
  
  import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
  
  import { AutoEnvCreationSettingsForm } from './AutoEnvCreationSettingsForm';
  
  const commands = {
    linux: [
      commandsTabs.k8sLinux,
      commandsTabs.swarmLinux,
      commandsTabs.standaloneLinux,
      commandsTabs.nomadLinux,
    ],
    win: [commandsTabs.swarmWindows, commandsTabs.standaloneWindow],
  };
  
  export function AutomaticEdgeEnvCreation() {
    const edgeKeyMutation = useGenerateKeyMutation();
    const { mutate: generateKey } = edgeKeyMutation;
    const settingsQuery = useSettings();
  
    const url = settingsQuery.data?.EdgePortainerUrl;
  
    useEffect(() => {
      if (url) {
        generateKey();
      }
    }, [generateKey, url]);
  
    if (!settingsQuery.data) {
      return null;
    }
  
    const edgeKey = edgeKeyMutation.data;
  
    return (
      <Widget>
        <WidgetTitle
          icon="fa-laptop"
          title="Automatic Edge Environment Creation"
        />
        <WidgetBody>
          <AutoEnvCreationSettingsForm settings={settingsQuery.data} />
  
          {edgeKeyMutation.isLoading ? (
            <div>Generating key for {url} ... </div>
          ) : (
            edgeKey && (
              <EdgeScriptForm
                edgeInfo={{ key: edgeKey }}
                commands={commands}
                isNomadTokenVisible
              />
            )
          )}
        </WidgetBody>
      </Widget>
    );
  }
  
  // using mutation because we want this action to run only when required
  function useGenerateKeyMutation() {
    return useMutation(generateKey);
  }
  