// @flow
import type { TextAreaProps } from './text-area.proptypes';
import { getPaletteColor } from '../../../mixins/branding';

export const getTextareaHeight = ({ height }: TextAreaProps<*>) =>
  height != null && height !== '' ? height : '108px';

export const getResizable = ({ resize = false }: TextAreaProps<*>) =>
  resize ? 'vertical' : 'none';

export const getTextColor = (props: TextAreaProps<*>) => {
  if (props.disabled) {
    return getPaletteColor('greyscale-dark');
  }

  return getPaletteColor('greyscale-black');
};
