mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
21 lines
511 B
TypeScript
21 lines
511 B
TypeScript
// @ts-nocheck
|
|
import React, { useMemo } from 'react';
|
|
import '@/style/components/Skeleton.scss';
|
|
|
|
import { randomNumber } from '@/utils';
|
|
|
|
export function SkeletonText({
|
|
Tag = 'span',
|
|
charsLength,
|
|
minChars = 40,
|
|
maxChars = 100,
|
|
}) {
|
|
const computedCharLength = useMemo(
|
|
() => (charsLength ? charsLength : randomNumber(minChars, maxChars)),
|
|
[charsLength, minChars, maxChars],
|
|
);
|
|
const randamText = 'X'.repeat(computedCharLength);
|
|
|
|
return <Tag className={'skeleton'}>{randamText}</Tag>;
|
|
}
|