
import { register } from "@antv/x6-react-shape";
import { Node } from "@antv/x6";
import CustomInput from "../CustomInput";

const component = ({ node }: { node: Node }) => {
  const { label, text} = node.getData();
  return (
    <>
      <div className="relative text-0 w-full h-full">
        <CustomInput value={label} styles={text} node={node} />
      </div>
    </>
  );
};

register({
  shape: "custom-react-text",
  width: 120,
  height: 40,
  effect: ["data"],
  component: component,
});

const Text = {
  name: "文本",
  icon: require("./image/text.svg").default,
  node: {
    shape: "custom-react-text",
    data: {
      label: "文本",
    },
  },
};

export default Text;
