@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
84 lines (83 loc) • 2.68 kB
JavaScript
import React, { Component } from 'react';
import { ContactName_defaultProps } from "./props/defaultProps";
import { ContactName_propTypes } from "./props/propTypes";
import { Container, Box } from '@zohodesk/components/es/Layout';
import Link from "../../Link/Link";
import SentimentStatus from "../SentimentStatus/SentimentStatus";
import { Icon } from '@zohodesk/icons';
import style from "./SecondaryText.module.css";
export default class ContactName extends Component {
render() {
let {
dataTitle,
dataId,
isPaidUser,
urlName,
urlData,
onClick,
sentimentType,
isLink,
className,
text,
href,
notAccessible = false,
fontWeight,
i18nKeys,
customProps
} = this.props;
let {
sentimentTitles = {
positive: 'Positive',
negative: 'Negative',
neutral: 'Neutral'
},
paidTitle = 'Paid User'
} = i18nKeys;
let sentimentDataTitle = sentimentTitles[sentimentType];
let {
LinkProps = {},
TextProps = {}
} = customProps;
return /*#__PURE__*/React.createElement(Container, {
alignBox: "row",
align: "baseline",
isCover: false,
dataId: dataId
}, isPaidUser && /*#__PURE__*/React.createElement(Box, {
className: style.paidUserIcon,
title: paidTitle,
"aria-label": "Paid user"
}, /*#__PURE__*/React.createElement(Icon, {
name: "ZD-paiduser",
iconClass: style.icon
})), /*#__PURE__*/React.createElement(Box, {
flexible: true
}, isLink ? /*#__PURE__*/React.createElement(Link, {
urlName: urlName,
href: href,
urlData: urlData,
onClick: onClick,
title: dataTitle,
dataId: `${dataId}_link`,
className: style.link,
...LinkProps,
ariaLabel: `Contact Name ${text}`
}, /*#__PURE__*/React.createElement("div", {
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
}, text)) : /*#__PURE__*/React.createElement("div", {
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''} ${notAccessible ? style.disable : ''}`,
"data-title": dataTitle,
...TextProps
}, text)), sentimentType && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(SentimentStatus, {
type: sentimentType,
dataTitle: sentimentDataTitle
})));
}
}
ContactName.propTypes = ContactName_propTypes;
ContactName.defaultProps = ContactName_defaultProps; // if (__DOCS__) {
// ContactName.docs = {
// folderName: 'List',
// componentGroup: 'ContactName'
// };
// }