import { RectNode, RectNodeModel } from '@logicflow/core'

class NormalTaskModel extends RectNodeModel {
  initNodeData(data) {
    super.initNodeData(data)
    this.height = 30
  }
  getNodeStyle() {
    const style = super.getNodeStyle()
    style.fill = '#fff'
    style.strokeWidth = 1
    style.stroke = '#ccc'

    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 NormalTaskView extends RectNode {}

export default {
  type: 'NormalTask',
  model: NormalTaskModel,
  view: NormalTaskView
}
