fix(archive): animate loading ellipsis

This commit is contained in:
Tommaso Casaburi
2026-04-29 16:41:56 +07:00
parent b951e8317b
commit 042f2df223
4 changed files with 24 additions and 2 deletions
@@ -4,8 +4,11 @@ interface LoadingEllipsisProps {
string: string;
}
const TRAILING_ELLIPSIS_PATTERN = /\s*(?:\.\.\.|\u2026)\s*$/;
const LoadingEllipsis = ({ string }: LoadingEllipsisProps) => {
const words = string.split(' ');
const normalizedString = string.replace(TRAILING_ELLIPSIS_PATTERN, '');
const words = normalizedString.split(' ');
const lastWord = words.pop();
const restOfString = words.join(' ');