Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 5x 5x 5x 5x 1x 4x 5x 1x 1x | import React from 'react';
import { defaultProps } from './props/defaultProps';
import { propTypes } from './props/propTypes';
import Link from '../../../Link/Link';
import style from './TableText.module.css';
export default class Text extends React.Component {
render() {
let { text, url, onClick, type, palette, className, size, dataId, title = null, target } = this.props;
title = title || text;
let textComponent;
let classNameCheck = `${type ? style[type] : ''} ${style[`${palette}Color`]} ${style[size]} ${className} ${
onClick ? style.isClickable : ''
}`;
if (url) {
textComponent = (
<Link title={title} dataId={dataId} href={url} target={target} className={classNameCheck} onClick={onClick}>
{text}
</Link>
);
} else {
textComponent = (
<div data-title={title} data-id={dataId} data-test-id={dataId} className={classNameCheck} onClick={onClick}>
{text}
</div>
);
}
return textComponent;
}
}
Text.defaultProps = defaultProps;
Text.propTypes = propTypes;
// if (__DOCS__) {
// Text.docs = {
// componentGroup: 'Text',
// folderName: 'Setup'
// };
// }
|