mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 17:03:53 +00:00
b7e758bf24
* chore: add typescript and dependencies * refactor: remove react imports * refactor: fix entrypoint * chore: upgrade chakra and deps * chore: configure eslint
51 lines
1.3 KiB
React
51 lines
1.3 KiB
React
import PropTypes from 'prop-types';
|
|
|
|
import EditableTimer from '../input/EditableTimer';
|
|
|
|
import style from './Times.module.scss';
|
|
|
|
export default function Times(props) {
|
|
const { handleValidate, actionHandler, timeStart, timeEnd, duration, previousEnd } = props;
|
|
|
|
return (
|
|
<>
|
|
<span className={style.label}>Start</span>
|
|
<EditableTimer
|
|
name='timeStart'
|
|
validate={handleValidate}
|
|
actionHandler={actionHandler}
|
|
time={timeStart}
|
|
delay={0}
|
|
previousEnd={previousEnd}
|
|
/>
|
|
<span className={style.label}>End</span>
|
|
<EditableTimer
|
|
name='timeEnd'
|
|
validate={handleValidate}
|
|
actionHandler={actionHandler}
|
|
time={timeEnd}
|
|
delay={0}
|
|
previousEnd={previousEnd}
|
|
/>
|
|
<span className={style.label}>Duration</span>
|
|
<EditableTimer
|
|
name='durationOverride'
|
|
validate={handleValidate}
|
|
actionHandler={actionHandler}
|
|
time={duration}
|
|
delay={0}
|
|
previousEnd={previousEnd}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
Times.propTypes = {
|
|
handleValidate: PropTypes.func.isRequired,
|
|
actionHandler: PropTypes.func.isRequired,
|
|
timeStart: PropTypes.number,
|
|
timeEnd: PropTypes.number,
|
|
duration: PropTypes.number,
|
|
previousEnd: PropTypes.number,
|
|
};
|