Files
2024-02-15 17:01:50 +00:00

21 lines
509 B
TypeScript

import {getDuration, getExactDuration} from 'sentry/utils/formatters';
interface Props extends React.HTMLAttributes<HTMLSpanElement> {
seconds: number;
abbreviation?: boolean;
exact?: boolean;
fixedDigits?: number;
}
function Duration({seconds, fixedDigits, abbreviation, exact, ...props}: Props) {
return (
<span {...props}>
{exact
? getExactDuration(seconds, abbreviation)
: getDuration(seconds, fixedDigits, abbreviation)}
</span>
);
}
export default Duration;