mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
db0eee3b9c
* chore: upgrade dependencies * feat/mac: draft pipeline * feat/mac: use public folder for transient files * feat/mac: set app fullscreen * feat/mac: cmd + , toggles menu * feat/mac: update readme * refact: easier login process * refact prevent style issues with safari * refact reduce css download * style: cleanup paginator design * style: studio clock is responsive * style: fix spacing style issues with safari
29 lines
755 B
React
29 lines
755 B
React
import React, { memo } from 'react';
|
|
import { formatDisplay } from 'common/utils/dateConfig';
|
|
import PropTypes from 'prop-types';
|
|
import styles from './Countdown.module.scss';
|
|
|
|
const Countdown = ({ time, small, isNegative, hideZeroHours }) => {
|
|
// prepare display string
|
|
const display =
|
|
time != null && !isNaN(time) ? formatDisplay(time, hideZeroHours) : '-- : -- : --';
|
|
|
|
const classes = `${small ? styles.countdownClockSmall : styles.countdownClock}
|
|
${isNegative ? styles.negative : ''}`;
|
|
|
|
return (
|
|
<div className={classes}>
|
|
{display}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default memo(Countdown);
|
|
|
|
Countdown.propTypes = {
|
|
time: PropTypes.number,
|
|
small: PropTypes.bool,
|
|
isNegative: PropTypes.bool,
|
|
hideZeroHours: PropTypes.bool,
|
|
};
|