import{jsxs as r,jsx as e,Fragment as f}from"react/jsx-runtime";import{token as t}from"@styled/tokens";import b from"../../icons/ico-globe.js";import v from"../../icons/ico-remove.js";import a from"../../primitives/button.js";import"../../primitives/checkbox.js";import"../../primitives/dropdown-selector.js";import{Popover as c}from"../../primitives/popover.js";import"../../primitives/radio.js";import"../../primitives/segmented-control.js";import"../../primitives/switch.js";import n from"../../primitives/text.js";import{css as y}from"@styled/css/css";import{Circle as d,Stack as u,Divider as w}from"@styled/jsx";import{useState as z,useEffect as C}from"react";const L=({connected:o,connectedLabel:h="Connected",disconnectLabel:l,disconnectedLabel:m="Not connected",domain:p,logoUrl:i,onDisconnect:g})=>{const[x,s]=z(!1);return C(()=>{s(!1)},[i]),r(c,{iconSize:28,variant:"text",children:[e(c.LeadingIcon,{color:t("colors.text.tertiary"),children:i&&o&&!x?r(d,{position:"relative",w:7,h:7,children:[e("img",{style:{borderRadius:"50%"},width:28,height:28,src:i,alt:"app logo",onError:()=>s(!0)}),e(d,{size:"7px",position:"absolute",bg:"positive.base",borderWidth:"thin",borderColor:"surface.primary",bottom:"-1px",right:"-1px",boxSizing:"border-box"})]}):r("svg",{width:"28",height:"28",children:[e("circle",{cx:"14",cy:"14",r:"14",fill:t("colors.surface.tertiary")}),e(b,{color:t("colors.text.tertiary"),x:6,y:6,height:16,width:16})]})}),r(c.Content,{className:y({w:"200px"}),children:[r(u,{w:"100%",gap:1,overflow:"hidden",children:[o?e(n,{size:"xs",variant:"success",fontWeight:"normal",children:h}):e(n,{fontColor:"text.tertiary",size:"xs",children:m}),e(n,{truncate:!0,children:p})]}),o&&l&&r(f,{children:[e(w,{color:"surface.quaternary",my:3}),e(a,{label:l,size:"sm",textStyle:"negative",variant:"text",onPress:g,children:e(a.LeadingIcon,{children:r("svg",{width:"20",height:"20",children:[e("circle",{cx:"8",cy:"8",r:"8",fill:t("colors.negative.lightest")}),e(v,{color:t("colors.negative.base"),x:3,y:3,height:10,width:10})]})})})]})]})]})};export{L as ConnectionMenu};
//# sourceMappingURL=connection-menu.js.map
