/*
 * @Author: your name
 * @Date: 2022-04-21 13:54:31
 * @Description:
 * @FilePath: /zl-large-screen/src/components/LargeScreenElement/LargeScreenElementSubMenu/index.tsx
 */

import React from 'react';

import { ILargeScreenElementSubMenuProps } from '../../../type/LargeScreenElement';

const LargeScreenElementSubMenu: React.FC<ILargeScreenElementSubMenuProps> = (
  props
) => {
  const { list = [], click } = props;

  return (
    <div className="zl-ls-element-sub-silder">
      <ul>
        {list.map((item) => {
          return (
            <li
              key={item?.key}
              onClick={() => !item?.disabled && click?.(item)}
              className={item?.disabled ? "disabled" :item?.selected ? 'current' : ''}
              style={{cursor: item?.disabled ? 'not-allowed' : 'pointer'}}
            >
              {item?.label}
            </li>
          );
        })}
      </ul>
    </div>
  );
};

export default LargeScreenElementSubMenu;
