mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
chore: lower case text + facelift (#25263)
* chore: lower case text * wip * wip * pr feedback * pr feedback
This commit is contained in:
@@ -446,3 +446,17 @@ export const withoutIcons = (actions: ActionItem[]): ActionItem[] =>
|
||||
actions.map((action) => ({ ...action, icon: undefined }));
|
||||
|
||||
export const isEnabled = ({ $if }: IfLike) => $if?.() ?? true;
|
||||
|
||||
export const transformToTitleCase = (text: string) => {
|
||||
if (text.length === 0) {
|
||||
return text;
|
||||
} else if (text.length === 1) {
|
||||
return text.charAt(0).toUpperCase();
|
||||
}
|
||||
|
||||
let result = '';
|
||||
for (const word of text.toLowerCase().split(' ')) {
|
||||
result += word.charAt(0).toUpperCase() + word.slice(1) + ' ';
|
||||
}
|
||||
return result.trim();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user