import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import NumericDataEntry from './numeric-data-entry'; class YearDataEntry extends Component { // TODO: add proper types static propTypes = { // TODO: generate propTypes from TS year: PropTypes.number, upper: PropTypes.number, lower: PropTypes.number, mode: PropTypes.string, onChange: PropTypes.func, copy: PropTypes.shape({ copying: PropTypes.bool, copyingKey: PropTypes.func, toggleCopyAttribute: PropTypes.func }) }; constructor(props) { super(props); this.state = { year: props.year, upper: props.upper, lower: props.lower, decade: Math.floor(props.year / 10) * 10, century: Math.floor(props.year / 100) * 100 } } // TODO add dropdown for decade, century // TODO roll in first/last year estimate // TODO handle changes internally, reporting out date_year, date_upper, date_lower render() { const props = this.props; return ( ) } } export default YearDataEntry;