bigbuffet-rw/app/soapbox/features/placeholder/components/placeholder-display-name.tsx
marcin mikołajczak 81de0014d3 Change ESLint rules, lint
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-02-16 00:12:02 +01:00

24 lines
732 B
TypeScript

import React from 'react';
import { randomIntFromInterval, generateText } from '../utils';
interface IPlaceholderDisplayName {
maxLength: number
minLength: number
withSuffix?: boolean
}
/** Fake display name to show when data is loading. */
const PlaceholderDisplayName: React.FC<IPlaceholderDisplayName> = ({ minLength, maxLength, withSuffix = true }) => {
const length = randomIntFromInterval(maxLength, minLength);
const acctLength = randomIntFromInterval(maxLength, minLength);
return (
<div className='flex flex-col text-primary-50 dark:text-primary-800'>
<p>{generateText(length)}</p>
{withSuffix && <p>{generateText(acctLength)}</p>}
</div>
);
};
export default PlaceholderDisplayName;