import { RectNode, RectNodeModel } from "@logicflow/core";
import { colors } from "../configs";

class NormalTaskModel extends RectNodeModel {
  initNodeData(data: any) {
    super.initNodeData(data);
    this.height = 30;
  }
  getNodeStyle() {
    const style = super.getNodeStyle();
    style.fill = colors.normal.background;
    style.stroke = colors.normal.border;
    style.strokeWidth = 1;
    return style;
  }
  getDefaultAnchor() {
    const { x, y, id } = this;
    return [
      {
        x: x,
        y: y + 15,
        name: "bottom",
        id: `${id}_0`
      },
      {
        x: x,
        y: y - 15,
        name: "top",
        id: `${id}_0`
      }
    ];
  }
}

class NormalTask extends RectNode {}

export default {
  type: "NormalTask",
  view: NormalTask,
  model: NormalTaskModel
};
