1"use strict";(self.webpackChunkheadlamp_website=self.webpackChunkheadlamp_website||[]).push([[16855],{11150:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>o,toc:()=>u});var r=n(74848),i=n(28453);const s={},l="Function: registerClusterProviderMenuItem()",o={id:"latest/development/api/plugin/registry/functions/registerClusterProviderMenuItem",title:"Function: registerClusterProviderMenuItem()",description:"Defined in893",source:"@site/docs/latest/development/api/plugin/registry/functions/registerClusterProviderMenuItem.md",sourceDirName:"latest/development/api/plugin/registry/functions",slug:"/latest/development/api/plugin/registry/functions/registerClusterProviderMenuItem",permalink:"/docs/latest/development/api/plugin/registry/functions/registerClusterProviderMenuItem",draft:!1,unlisted:!1,editUrl:"https://github.com/kubernetes-sigs/headlamp/edit/main/docs/development/api/plugin/registry/functions/registerClusterProviderMenuItem.md",tags:[],version:"current",frontMatter:{},sidebar:"mainSidebar",previous:{title:"Function: registerClusterProviderDialog()",permalink:"/docs/latest/development/api/plugin/registry/functions/registerClusterProviderDialog"},next:{title:"Function: registerClusterStatus()",permalink:"/docs/latest/development/api/plugin/registry/functions/registerClusterStatus"}},d={},u=[{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Example",id:"example",level:2}];function a(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"function-registerclusterprovidermenuitem",children:"Function: registerClusterProviderMenuItem()"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"function registerClusterProviderMenuItem(item: MenuItemComponent): void;\n"})}),"\n",(0,r.jsxs)(t.p,{children:["Defined in: ",(0,r.jsx)(t.a,{href:"https://github.com/kubernetes-sigs/headlamp/blob/9cb8e9a311f736f645f4a06f251f59bddca3cf60/frontend/src/plugin/registry.tsx#L893",children:"plugin/registry.tsx:893"})]}),"\n",(0,r.jsx)(t.p,{children:"Register a new cluster action menu item."}),"\n",(0,r.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"item"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"MenuItemComponent"})}),(0,r.jsx)(t.td,{children:"The item to add to the cluster action menu."})]})})]}),"\n",(0,r.jsx)(t.h2,{id:"returns",children:"Returns"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"void"})}),"\n",(0,r.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",children:"import { registerClusterProviderMenuItem } from '@kinvolk/headlamp-plugin/lib';\nimport { MenuItem, ListItemText } from '@mui/material';\nregisterClusterProviderMenuItem(({cluster, setOpenConfirmDialog, handleMenuClose}) => {\n const isMinikube =\n cluster.meta_data?.extensions?.context_info?.provider === 'minikube.sigs.k8s.io';\n if (!isElectron() !! !isMinikube) {\n return null;\n }\n return (\n <MenuItem\n onClick={() => {\n setOpenConfirmDialog('deleteMinikube');\n handleMenuClose();\n }}\n >\n <ListItemText>{t('translation|Delete')}</ListItemText>\n </MenuItem>\n );\n)}\n"})})]})}function c(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},28453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>o});var r=n(96540);const i={},s=r.createContext(i);function l(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.