import { UserAccountAuthPermListProps } from '../model/types';
import { UserAccountAuthPermItem } from './user-account-auth-perm-item';
export const UserAccountAuthPermList = ({
  tid,
  permItems
}: UserAccountAuthPermListProps) => {

  const getPermItems = () => {
    let rs = [];
    for(let i=0;i<permItems.length;i++){
      rs.push(
        <UserAccountAuthPermItem
          key={ 'key-perm-item-' + i }
          tid={ tid }
          menuId={ permItems[i]?.menuId }
          permName={ permItems[i]?.permName }
        ></UserAccountAuthPermItem>
      );
    }
    return rs;
  };

  return (
    <>
      <div className="perm-list">
        { getPermItems() }
      </div>
    </>
  );
};