refactor: timer design review

This commit is contained in:
Carlos Valente
2025-07-12 11:55:49 +02:00
parent 2aac4cb06d
commit 05d01e0863
9 changed files with 131 additions and 33 deletions
@@ -55,6 +55,18 @@ export function isStringBoolean(text: string | null) {
return text?.toLowerCase() === 'true' || text === '1';
}
/**
* Prepares a colour string for use in views
* Colours in params do not have the #prefix
*/
export function makeColourString(hex: string | null): string | undefined {
if (!hex) {
return undefined;
}
// ensure the hex starts with a #
return hex.startsWith('#') ? hex : `#${hex}`;
}
/**
* Retrieves a dynamic property from an event
* Considers custom fields