• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

carbon-design-system / carbon-addons-iot-react / 4821844224

pending completion
4821844224

push

github

carbon-bot
v2.153.0-next.16

7749 of 8086 branches covered (95.83%)

Branch coverage included in aggregate %.

9344 of 9448 relevant lines covered (98.9%)

2515.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/packages/react/src/components/CardEditor/CardEditForm/CardEditFormItems/ContentFormItemTitle.jsx
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
import { Tooltip, Link } from 'carbon-components-react';
4

5
import { settings } from '../../../../constants/Settings';
6

7
const { iotPrefix } = settings;
16✔
8

9
const propTypes = {
16✔
10
  title: PropTypes.string,
11
  tooltip: PropTypes.shape({
12
    tooltipText: PropTypes.string,
13
    href: PropTypes.string,
14
    linkText: PropTypes.string,
15
  }),
16
};
17

18
const defaultProps = {
16✔
19
  title: 'Data',
20
  tooltip: null,
21
};
22

23
const ContentFormItemTitle = ({ title, tooltip }) => {
16✔
24
  const { tooltipText, linkText, href } = tooltip || {};
159✔
25
  return (
159✔
26
    <div className={`${iotPrefix}--card-edit-form--form-section`}>
27
      {title ? <div>{title}</div> : null}
159!
28
      <div>
29
        {tooltip ? (
159✔
30
          <Tooltip
31
            direction="left"
32
            triggerId={`card-edit-form-${title}`}
33
            tooltipId={`card-edit-form-${title}`}
34
          >
35
            <p>
36
              {tooltipText}{' '}
37
              {href && linkText ? (
321✔
38
                <Link href={href} target="_blank" rel="noopener noreferrer">
39
                  {linkText}
40
                </Link>
41
              ) : null}
42
            </p>
43
          </Tooltip>
44
        ) : null}
45
      </div>
46
    </div>
47
  );
48
};
49

50
ContentFormItemTitle.propTypes = propTypes;
16✔
51
ContentFormItemTitle.defaultProps = defaultProps;
16✔
52
export default ContentFormItemTitle;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc