import { ListDateGroup } from '../list-date-group';
import { AccountHolderAuthListProps, AdditionalServiceCategory } from '../../model/types';

export const AccountHolderAuthList = ({
    listItems,
    mid
}: AccountHolderAuthListProps) => {

    const getListDateGroup = () => {
        let rs = [];
        for (const [key, value] of Object.entries(listItems)) {
            rs.push(
                <ListDateGroup
                    additionalServiceCategory={AdditionalServiceCategory.AccountHolderAuth}
                    key={key}
                    date={key}
                    items={value}
                    mid={mid}
                ></ListDateGroup>
            )
        }
        return rs;
    };

    return (
        <>
            <div className="transaction-list">
                {getListDateGroup()}
            </div>
        </>
    )
}