import { getElementId, randomCode } from "../../plugins/utils";

const LINE_HORIZONTAL = {
  type: "LINE_HORIZONTAL",
  x: 0,
  y: 0,
  w: 300,
  h: 30,
  sign: "",
  bold: "1px",
  color: "#000000",
  style: "solid",
};
// 竖线
const LINE_VERTICAL = {
  type: "LINE_VERTICAL",
  x: 0,
  y: 0,
  w: 30,
  h: 300,
  sign: "",
  bold: "1px",
  color: "#000000",
  style: "solid",
};

const getModel = (type) => {
  const model = type === "HORIZONTAL" ? LINE_HORIZONTAL : LINE_VERTICAL;
  return {
    id: getElementId(),
    key: randomCode(),
    ...model,
  };
};

export { LINE_HORIZONTAL, LINE_VERTICAL, getModel };
