import React, { FC } from 'react';
import { useTheme } from '../Theme';
import { StyledHelperText } from './styled-component';
import { HelperTextProps } from './types.d';

export const HelperText: FC<HelperTextProps> = (props) => {
  const { children, error } = props;
  const theme = useTheme();
  return (
    // eslint-disable-next-line react/jsx-props-no-spreading
    <StyledHelperText {...props} error={error} $theme={theme}>
      {children}
    </StyledHelperText>
  );
};
