mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
25 lines
520 B
TypeScript
25 lines
520 B
TypeScript
import styles from './loading-ellipsis.module.css';
|
|
|
|
interface LoadingEllipsisProps {
|
|
string: string;
|
|
}
|
|
|
|
const LoadingEllipsis = ({ string }: LoadingEllipsisProps) => {
|
|
const words = string.split(' ');
|
|
const lastWord = words.pop();
|
|
const restOfString = words.join(' ');
|
|
|
|
return (
|
|
<span>
|
|
{restOfString}
|
|
{restOfString && ' '}
|
|
<span className={styles.nowrap}>
|
|
{lastWord}
|
|
<span className={styles.ellipsis} />
|
|
</span>
|
|
</span>
|
|
);
|
|
};
|
|
|
|
export default LoadingEllipsis;
|