bigbuffet-rw/app/soapbox/features/placeholder/components/placeholder-display-name.tsx
2022-11-15 14:00:40 -05:00

23 lines
676 B
TypeScript

import React from 'react';
import { randomIntFromInterval, generateText } from '../utils';
interface IPlaceholderDisplayName {
maxLength: number,
minLength: number,
}
/** Fake display name to show when data is loading. */
const PlaceholderDisplayName: React.FC<IPlaceholderDisplayName> = ({ minLength, maxLength }) => {
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>
<p>{generateText(acctLength)}</p>
</div>
);
};
export default PlaceholderDisplayName;