import{a as r,F as f,j as e}from"./index-b983ad9b.js";/* empty css                *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{r as c}from"./react-b0e0d18a.js";import{M as u}from"./MonoEventTrigger-c155a44e.js";import{s as o}from"./TriggerSetting-c8c5e754.js";import{B as h,r as E,M as v,c as x,E as m}from"./antd-8ca2e36c.js";/* empty css              */function b({triggerKey:t,update:d,onChange:l,onAdd:a}){const[s,n]=c.useState();return c.useEffect(()=>(t?(async()=>{const i=await u.getTrigger(t);n(i)})():n(null),()=>{}),[t,d]),r(f,{children:[r("div",{className:o.sectionTitle,children:[e("span",{className:"title",children:"预警事件"}),e(h,{size:"small",shape:"circle",icon:e(E,{}),onClick:()=>{a&&a(`${t}-add`)},disabled:!t})]}),e("div",{className:o.sectionContent,children:s!=null&&s.rules&&(s!=null&&s.rules.length)?e(v,{mode:"vertical",onClick:({key:i})=>{l&&l(i)},items:s==null?void 0:s.rules.map((i,p)=>({key:`${t}-${p}`,label:e("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:e("div",{style:{flex:1},children:e(x,{children:e("span",{className:"name",children:i.name})})})})}))}):e("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e(m,{image:m.PRESENTED_IMAGE_SIMPLE,description:""})})})]})}export{b as default};
