import { Button, Space } from "antd"; import { useEffect, useState } from "react"; import { useAppSelector } from "../../../hooks"; import { add, relationAddParam } from "../../../reducers/relation-add"; import store from "../../../store"; import type { IWbw } from "./WbwWord" export const relationWordId = (word: IWbw) => { return `${word.book}-${word.para}-` + word.sn.join("-"); }; interface IWidget { data: IWbw; } const WbwRelationAddWidget = ({ data }: IWidget) => { const [show, setShow] = useState(false); const addParam = useAppSelector(relationAddParam); useEffect(() => { if (addParam?.command === "add") { setShow(true); } else { setShow(false); } }, [addParam?.command]); return (