@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
65 lines (57 loc) • 1.84 kB
JavaScript
/*** Libraries ***/
import React, { Component } from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
import EmptyAccounts from '@zohodesk/svg/lib/emptystate/version3/EmptyAccounts';
import EmptyContact from '@zohodesk/svg/lib/emptystate/version3/EmptyContact';
import EmptyProducts from '@zohodesk/svg/lib/emptystate/version3/EmptyProducts';
/*** CSS ***/
import style from "./LookupEmptyPage.module.css";
export default class EmptyPage extends Component {
constructor(props) {
super(props);
this.renderEmptyState = this.renderEmptyState.bind();
}
renderEmptyState(type) {
switch (type) {
case 'search':
return /*#__PURE__*/React.createElement(EmptySearch, {
className: style.image
});
case 'account':
return /*#__PURE__*/React.createElement(EmptyAccounts, {
className: style.image
});
case 'contact':
return /*#__PURE__*/React.createElement(EmptyContact, {
className: style.image
});
case 'product':
return /*#__PURE__*/React.createElement(EmptyProducts, {
className: style.image
});
default:
return null;
}
}
render() {
let {
type,
title
} = this.props;
return /*#__PURE__*/React.createElement("div", {
className: style.container,
"data-id": `empty_${type}`,
"data-test-id": `empty_${type}`
}, this.renderEmptyState(type), /*#__PURE__*/React.createElement("div", {
className: style.contentDiv
}, title));
}
}
EmptyPage.propTypes = propTypes;
EmptyPage.defaultProps = defaultProps; // if (__DOCS__) {
// EmptyPage.docs = {
// componentGroup: 'Lookup'
// };
// }