style: cuesheet block (#355)

* style: cuesheet show block title

* style: cuesheet show full delay string
This commit is contained in:
Carlos Valente
2023-04-23 10:18:19 +02:00
committed by GitHub
parent db9cb61164
commit 8f834fed35
5 changed files with 12 additions and 14 deletions
@@ -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,
};