import type { getUserImages } from "../network";

export const groupPropertiesWithImage = ({
    UserImages,
    ImageProperties,
}: Awaited<ReturnType<typeof getUserImages>>) => {
    const imageToProperties: Record<string, typeof ImageProperties> = {};

    for (const image of UserImages) {
        imageToProperties[image.ImageID] = ImageProperties.filter((i) =>
            i.data.Images.includes(image.ImageID),
        );
    }

    return imageToProperties;
};
