import{r as n,e as b,j as t,g as R,P as w,a as y,aq as C}from"./main-gLMaKCvr.js";import{C as S}from"./index-Jdu54dr5.js";import{R as E}from"./DeleteOutlined-CBRh7405.js";import{R as F}from"./study-page-BLC-2qgz.js";import"./index-ZwmWfN3I.js";import"./Dropdown-CSp8FTqG.js";import"./usePagination-DK-N3QaW.js";import"./Table-CWRWFg95.js";import"./addEventListener-BwXlid1p.js";import"./index-B-_sZvQI.js";const J=({close:l,height:$,data:e,loadGraph:j,...i})=>{var c,x;const[o,s]=n.useState(),[h,d]=n.useState(!1),{messageApi:r}=b(),f=async()=>{var g,u;d(!0);const N=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(N.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(S,{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(R,{gap:"small",children:[t.jsx(w,{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}`),r.success("删除成功"),l(),j()},children:t.jsx(E,{})}),t.jsx(F,{onClick:f}),t.jsx(C,{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{J as default};
