mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 01:43:43 +00:00
dce87c3a81
* inti relative mode * send imediat update on mode change * add relative to test * don't persist offset mode * add test relative and update calc function * pass data from ssocket * add dev guard * spelling and comments * show relative in offset overview * remove comments * refactor: move totalDelay to _rundown * update clear naming and comments * remove old testing values
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { Tooltip } from '@chakra-ui/react';
|
|
|
|
import { cx } from '../../../common/utils/styleUtils';
|
|
|
|
import style from './TimeLayout.module.scss';
|
|
|
|
interface TimeLayoutProps {
|
|
label: string;
|
|
value: string;
|
|
muted?: boolean;
|
|
daySpan?: number;
|
|
className?: string;
|
|
testId?: string;
|
|
}
|
|
|
|
export function TimeColumn({ label, value, muted, className, testId }: TimeLayoutProps) {
|
|
return (
|
|
<div className={style.column}>
|
|
<span className={style.label}>{label}</span>
|
|
<span className={cx([style.clock, muted && style.muted, className])} data-testid={testId}>
|
|
{value}
|
|
</span>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function TimeRow({ label, value, daySpan, muted, className }: TimeLayoutProps) {
|
|
return (
|
|
<div className={style.row}>
|
|
<span className={style.label}>{label}</span>
|
|
{daySpan ? (
|
|
<Tooltip label={`Event spans over ${daySpan + 1} days`}>
|
|
<span className={cx([style.clock, style.daySpan, className])}>{value}</span>
|
|
</Tooltip>
|
|
) : (
|
|
<span className={cx([style.clock, muted && style.muted, className])}>{value}</span>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|