/**
 * Compares design areas by size.
 *
 * @param {Object} firstDesignArea
 * @param {Object} firstDesignArea.baseShape
 * @param {number} firstDesignArea.baseShape.width
 * @param {number} firstDesignArea.baseShape.height
 * @param {Object} secondDesignArea
 * @param {Object} secondDesignArea.baseShape
 * @param {number} secondDesignArea.baseShape.width
 * @param {number} secondDesignArea.baseShape.height
 * @returns {number}
 */
export function compareDesignAreasBySize({ baseShape: firstBaseShape }, { baseShape: secondBaseShape }) {
    if (!firstBaseShape || !secondBaseShape) {
        return 0;
    }

    const firstSize = firstBaseShape.width * firstBaseShape.height;
    const secondSize = secondBaseShape.width * secondBaseShape.height;

    return secondSize - firstSize;
}
