"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1456],{"./public/app/features/org/SelectOrgPage.tsx":(e,a,n)=>{n.r(a),n.d(a,{SelectOrgPage:()=>l,default:()=>d});var t,s=n("./node_modules/react/index.js"),i=n("./public/app/core/components/Page/Page.tsx"),r=n("./packages/grafana-runtime/src/index.ts"),o=n("./node_modules/react-use/esm/useAsync.js"),c=n("./packages/grafana-ui/src/index.ts"),g=n("./node_modules/react/jsx-runtime.js");const u={main:{icon:"grafana",subTitle:"Preferences",text:"Select active organization"},node:{text:"Select active organization"}},l=()=>{const[e,a]=(0,s.useState)();return(0,o.Z)((async()=>{a(await(async()=>await(0,r.getBackendSrv)().get("/api/user/orgs"))())}),[]),(0,g.jsx)(i.Z,{navModel:u,children:(0,g.jsx)(i.Z.Contents,{children:(0,g.jsxs)("div",{children:[t||(t=(0,g.jsx)("p",{children:"You have been invited to another organization! Please select which organization that you want to use right now. You can change this later at any time."})),(0,g.jsx)(c.HorizontalGroup,{wrap:!0,children:e&&e.map((e=>(0,g.jsx)(c.Button,{icon:"signin",onClick:()=>(async e=>await(0,r.getBackendSrv)().post("/api/user/using/"+e.orgId).then((()=>{window.location.href=r.config.appSubUrl+"/"})))(e),children:e.name},e.orgId)))})]})})})},d=l}}]);
//# sourceMappingURL=SelectOrgPage.8128b05ac04b15cbf98d.js.map