import React from 'react';
import classNames from 'classnames';
import propTypes from 'prop-types';

const SprkLabelLocationCheck = ({
  children,
  type,
  label,
  leadingIcon,
  hiddenLabel,
  id,
}) => {
  if (type === 'hugeTextInput') {
    return (
      <>
        {children}
        <label
          htmlFor={id}
          className={classNames('sprk-b-Label', {
            'sprk-b-Label--with-icon': leadingIcon.length > 0,
            'sprk-u-ScreenReaderText': hiddenLabel && type !== "hugeTextInput",
          })}
        >
          {label}
        </label>
      </>
    );
  }
  return (
    <>
      <label
        htmlFor={id}
        className={classNames('sprk-b-Label', {
          'sprk-b-Label--with-icon': leadingIcon.length > 0,
          'sprk-u-ScreenReaderText': hiddenLabel && type !== "hugeTextInput",
        })}
      >
        {label}
      </label>
      {children}
    </>
  );
};

SprkLabelLocationCheck.propTypes = {
  type: propTypes.string,
  label: propTypes.string,
  leadingIcon: propTypes.string,
  id: propTypes.string,
};

export default SprkLabelLocationCheck;

@@ -431,88 +431,8 @@
  0,%0A
-            'sprk-u-ScreenReaderText': hiddenLabel && type !== %22hugeTextInput%22,%0A
     
@@ -720,36 +720,8 @@
 abel
- && type !== %22hugeTextInput%22
 ,%0A  

remove unecessary hidden label text for huge input