import{r as n,k as R,j as t,F as w,P as C,a as y,at as r}from"./main-BzPVmAp-.js";import{C as F}from"./index-7u0Bo8e4.js";import{R as S}from"./DeleteOutlined-DoDR38qq.js";import{R as k}from"./RedoOutlined-d_QTXv-s.js";import"./index-SGIbgpRk.js";import"./Dropdown-Clv_Pvnt.js";const _=({close:l,height:$,data:e,loadGraph:j,...i})=>{var c,x;const[o,s]=n.useState(),[h,d]=n.useState(!1),{messageApi:N}=R(),f=async()=>{var g,u;d(!0);const b=await y.get(`/entity-relation/find-by-paired-entity/${(g=e==null?void 0:e.fromNode)==null?void 0:g.id}/${(u=e==null?void 0:e.toNode)==null?void 0:u.id}`);s(b.data),d(!1)};return n.useEffect(()=>{e!=null&&e.fromNode&&(e!=null&&e.toNode)&&f()},[e==null?void 0:e.fromNode,e==null?void 0:e.toNode]),t.jsx(F,{loading:h,styles:{body:{padding:"0.5rem",height:"100%",overflowY:"auto"}},title:t.jsx(t.Fragment,{children:`${i==null?void 0:i.label} (${(c=e==null?void 0:e.fromNode)==null?void 0:c.label})->(${(x=e==null?void 0:e.toNode)==null?void 0:x.label})`}),size:"small",extra:t.jsx(t.Fragment,{children:t.jsxs(w,{gap:"small",children:[t.jsx(C,{title:`删除(${o==null?void 0:o.from_name})-[${o==null?void 0:o.type}]-(${o==null?void 0:o.to_name})?`,onConfirm:async()=>{await y.delete(`/entity-relation/relation/${o.rid}`),N.success("删除成功"),l(),j()},children:t.jsx(S,{})}),t.jsx(k,{onClick:f}),t.jsx(r,{onClick:l})]})}),style:{borderRadius:"12px",boxShadow:"0 4px 20px rgba(0,0,0,0.1)",padding:"0.5rem",overflow:"hidden",height:$},children:JSON.stringify(o)})};export{_ as default};
