import { UserManageAuthItem } from './user-manage-auth-item';
import { UserManageAuthListProps } from '../model/types';

export const UserManageAuthList = ({
  authItems
}: UserManageAuthListProps) => {
  
  const getUserManageAuthItems = () => {
    let rs = [];
    for(let i=0;i<authItems.length;i++){
      rs.push(
        <UserManageAuthItem
          key={ 'UserManageAuthItem-key-' + i }
          useYn={ authItems[i]?.useYn }
          authName= { authItems[i]?.authName }
          tid= { authItems[i]?.tid }
        ></UserManageAuthItem>
      );
    }
    return rs;
  }
  return (
    <>
      <div className="auth-list">
      { getUserManageAuthItems() }
      </div>
    </>
  );
};