text: import _pt from "prop-types";
  import React from 'react';
  import useStyles from '../../hooks/useStyles';
  import StatusText from '../StatusText';
  import { styleSheet } from './styles';
  
  /** Display a simple error message for use within forms. */
  export default function FormErrorMessage(_ref) {
    let {
      id,
      error
    } = _ref;
    const [styles, cx] = useStyles(styleSheet);
  
    if (!error) {
      return null;
    }
  
    return React.createElement("div", {
      id: id + "-error",
      role: "alert",
      "aria-live": "polite",
      className: cx(styles.error)
    }, React.createElement(StatusText, {
      danger: true
    }, error));
  }
  FormErrorMessage.propTypes = {
    id: _pt.string.isRequired,
    error: _pt.string
  };