import { getThemeConfig } from './themeConfig'
export const getBasicConfig = (
  properties,
  theme,
  type,
) => {
  let {
    custom: {
      backgroundColor,
      borderColor,
      borderWidth,
    },
    isFollowTheme,
  } = properties

  if (isFollowTheme) {
    if (theme && Object.keys(theme).length !== 0 && !!theme.css?.variables) {
      const themeConfig = getThemeConfig(theme, type)
      backgroundColor = themeConfig.backgroundColor
      borderColor = themeConfig.borderColor
      borderWidth = themeConfig.borderWidth
    }
  }

  return {
    backgroundColor,
    borderColor,
    borderWidth
  }
}