import {MenuEnum} from './index'
export const initLevel = 1
export const marginLeft = 24
export const isLinkClassName = (item: MenuEnum) =>
  item?.level! > 1 ? 'menu-link-title' : 'menu-title'
export const isSelectClassName = (item: MenuEnum) => `${item?.isChose ? 'chose' : ''}`
export const getBaseLists = (data: MenuEnum[], currentItem: MenuEnum) => {
  return data?.map(item => {
    return {
      ...item,
      child: item?.child?.map(i => {
        if (i?.id === currentItem?.id) {
          return {...i, isChose: true}
        }
        return {...i, isChose: false}
      }),
    }
  })
}
