import { useState } from 'react'; import { createPortal } from 'react-dom'; import { EnvironmentId } from '@/portainer/environments/types'; import { useAnalytics } from '@/angulartics.matomo/analytics-services'; import { Button } from '@@/buttons'; import { KubeCtlShell } from './KubectlShell'; import styles from './KubectlShellButton.module.css'; interface Props { environmentId: EnvironmentId; } export function KubectlShellButton({ environmentId }: Props) { const [open, setOpen] = useState(false); const { trackEvent } = useAnalytics(); return ( <> {open && createPortal( setOpen(false)} />, document.body )} ); function handleOpen() { setOpen(true); trackEvent('kubernetes-kubectl-shell', { category: 'kubernetes' }); } }