import * as React from "react";
import { times, random } from "lodash";
import generate from "./";

export const generateCheckItems = (
    items: number = random(5, 10)
): CheckItem[] => {
    return times(items, i => {
        return {
            id: generate.genId(),
            name: generate.genUsername(),
            children: Boolean(random(0, Math.floor(items / i)))
                ? []
                : generateCheckItems(random(1, 5)),
        };
    });
};
