mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
style: cuesheet block (#355)
* style: cuesheet show block title * style: cuesheet show full delay string
This commit is contained in:
@@ -6,7 +6,7 @@ export default function BlockRow(props) {
|
||||
const { row } = props;
|
||||
return (
|
||||
<tr {...row.getRowProps()}>
|
||||
<td className={style.blockCell}>Delay Block</td>
|
||||
<td className={style.blockCell}>{row.original?.title || 'Block'}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { millisToMinutes } from '../../../common/utils/dateConfig';
|
||||
import { millisToDelayString } from '../../../common/utils/dateConfig';
|
||||
|
||||
import style from '../Table.module.scss';
|
||||
|
||||
export default function DelayRow(props) {
|
||||
const { row } = props;
|
||||
const delayVal = row.original.duration;
|
||||
const minutesDelayed = Math.abs(millisToMinutes(delayVal));
|
||||
const labelText = `${minutesDelayed} minutes ${delayVal >= 0 ? 'delayed' : 'ahead'}`;
|
||||
const delayTime = delayVal !== 0 ? millisToDelayString(delayVal) : null;
|
||||
|
||||
return (
|
||||
<tr {...row.getRowProps()}>
|
||||
<td className={style.delayCell}>{labelText}</td>
|
||||
<td className={style.delayCell}>{delayTime}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
@@ -20,4 +19,3 @@ export default function DelayRow(props) {
|
||||
DelayRow.propTypes = {
|
||||
row: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user