import { CompoundedComponent } from "@/types"; import { register } from "@antv/x6-react-shape"; import { Node } from "@antv/x6"; import { ports, defaultData } from "../../config/data"; import CustomInput from "../CustomInput"; import { useSizeHook, useShapeProps } from "@/hooks"; const component = ({ node }: { node: Node }) => { const { label, text, fill, stroke, opacity } = node.getData(); const { size, ref } = useSizeHook(); const { fillContent, defsContent, strokeColor, strokeWidth, strokeDasharray, } = useShapeProps(fill, size, stroke); return ( <>
{defsContent}
); }; register({ shape: "custom-react-preparation", width: 100, height: 70, effect: ["data"], component: component, }); const preparation: CompoundedComponent = { name: "预备", icon: require("./image/preparation.png"), node: { shape: "custom-react-preparation", data: { label: "预备", ...defaultData, }, ports, }, }; export default preparation;