export enum MoreActionEvent {
  EDIT = 'edit',
  COPY = 'copy',
  DELETE = 'delete',
}

export enum VisualBoardPermission {
  UPDATE = 'api:yt:data_board:update:update',
  DELETE = 'api:yt:data_board:delete',
  CREATE = '',
  DETAIL = 'api:yt:data_component:list',
}

export enum VisualComponentPermission {
  UPDATE = 'api:yt:data_component:update:update',
  DELETE = 'api:yt:data_component:delete',
  COPY = 'api:yt:dataBoardDetail:copy',
  CREATE = 'api:yt:data_component:add:post',
}

export const DEFAULT_MAX_COL = 24;
export const DEFAULT_WIDGET_WIDTH = 6;
export const DEFAULT_WIDGET_HEIGHT = 6;
export const DEFAULT_MIN_HEIGHT = 5;
export const DEFAULT_MIN_WIDTH = 3;

export const DATA_BOARD_SHARE_URL = (
  boardId = ':boardId',
  tenantId = ':tenantId',
  name = ':boardName?'
) => `/data/board/share/${boardId}/${tenantId}/${name}`;

export const isBataBoardSharePage = (url: string) => {
  const reg = /^\/data\/board\/share/g;
  return reg.test(url);
};

export const encode = (string: string) => {
  return encodeURIComponent(string);
};

export const decode = (string: string) => {
  return decodeURIComponent(string);
};
