mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
18 lines
465 B
TypeScript
18 lines
465 B
TypeScript
export default function getConfirmationString(durations: Array<number>) {
|
|
if (durations.length === 0) {
|
|
return '';
|
|
}
|
|
|
|
const [ lower, upper ] = durations.map((time) => time / 1_000);
|
|
|
|
if (!upper) {
|
|
return `Confirmed within ${ lower.toLocaleString() } secs`;
|
|
}
|
|
|
|
if (lower === 0) {
|
|
return `Confirmed within <= ${ upper.toLocaleString() } secs`;
|
|
}
|
|
|
|
return `Confirmed within ${ lower.toLocaleString() } - ${ upper.toLocaleString() } secs`;
|
|
}
|