import derricSettings from './sub/mainDerrick'
import platformSettings from './sub/platform'
import undergroundSettings from './sub/underground'
import strataSettings from './sub/strata'
import poolPumpSettings from './sub/poolAndPump'

const composeProps = (minSize, themeColors) => {
    let publicProps = {
        minSize,
        mainSize: {}
    }
    const divW = document.getElementById('derrickChart').parentNode.clientWidth
    const divH = document.getElementById('derrickChart').parentNode.clientHeight
    publicProps.mainSize = {
        width: divW > minSize.width ? divW : minSize.width,
        height: divH > minSize.height ? divH : minSize.height
    }
    publicProps.colors = themeColors

    publicProps = {
        ...publicProps,
        ...derricSettings(publicProps)
    }
    publicProps = {
        ...publicProps,
        ...platformSettings(publicProps)
    }
    publicProps = {
        ...publicProps,
        ...undergroundSettings(publicProps)
    }
    publicProps = {
        ...publicProps,
        ...strataSettings(publicProps)
    }
    publicProps = {
        ...publicProps,
        ...poolPumpSettings(publicProps)
    }

    return publicProps
}
export default {
    composeProps
}
