import { i18n } from '@plugins/i18n';
import { v4 } from 'uuid';

export enum RoleTreeCode {
  ORGANIZATIONS = 'organizations',
  DEPARTMENTS = 'departments',
  EMPLOYEES = 'employees',
}
export const RoleTreeLabel = {
  ORGANIZATIONS: i18n.t('base.roleTreeType.organizations'),
  DEPARTMENTS: i18n.t('base.roleTreeType.departments'),
  EMPLOYEES: i18n.t('base.roleTreeType.employees'),
};

export function getTreeConfig(id: string, label: string): any {
  return {
    id,
    label,
    children: [
      {
        children: [],
        label: RoleTreeLabel.ORGANIZATIONS,
        id: v4(),
        code: RoleTreeCode.ORGANIZATIONS,
      },
      {
        children: [],
        label: RoleTreeLabel.DEPARTMENTS,
        id: v4(),
        code: RoleTreeCode.DEPARTMENTS,
      },
      {
        children: [],
        label: RoleTreeLabel.EMPLOYEES,
        id: v4(),
        code: RoleTreeCode.EMPLOYEES,
      },
    ],
  };
}
