| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 20 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import React from 'react'; |
||
| 2 | import PropTypes from 'prop-types'; |
||
| 3 | import { isEmpty } from 'ramda'; |
||
| 4 | import { compareVersions } from './utils'; |
||
| 5 | |||
| 6 | 2 | const propTypes = { |
|
| 7 | minVersion: PropTypes.string.isRequired, |
||
| 8 | currentServerVersion: PropTypes.string.isRequired, |
||
| 9 | children: PropTypes.node.isRequired, |
||
| 10 | }; |
||
| 11 | |||
| 12 | 2 | const ForVersion = ({ minVersion, currentServerVersion, children }) => |
|
| 13 | 4 | isEmpty(currentServerVersion) || compareVersions(currentServerVersion, '<', minVersion) |
|
| 14 | ? null |
||
| 15 | : <React.Fragment>{children}</React.Fragment>; |
||
| 16 | |||
| 17 | 2 | ForVersion.propTypes = propTypes; |
|
| 18 | |||
| 19 | export default ForVersion; |
||
| 20 |