import { Badge, Button, Collapse, Space, Tooltip } from "antd"; import { QuestionCircleOutlined } from "@ant-design/icons"; import WbwDetailRelation from "./WbwDetailRelation"; import store from "../../../store"; import { grammar } from "../../../reducers/command"; import type { IWbw, IWbwField } from "./WbwWord" import { useIntl } from "react-intl"; import { useState } from "react"; import { openPanel } from "../../../reducers/right-panel"; interface IWidget { data: IWbw; showRelation?: boolean; onChange?: Function; onRelationAdd?: Function; } const WbwDetailBasicRelationWidget = ({ data, showRelation, onChange, onRelationAdd, }: IWidget) => { const intl = useIntl(); const [fromList, setFromList] = useState(); const relationCount = data.relation?.value ? JSON.parse(data.relation.value).length : 0; return ( {intl.formatMessage({ id: "buttons.relate" })}