2022-01-10 14:17:52 -08:00
|
|
|
import React from 'react';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2021-10-11 12:00:59 -07:00
|
|
|
import { randomIntFromInterval, generateText } from '../utils';
|
|
|
|
|
2022-05-01 10:45:37 -07:00
|
|
|
interface IPlaceholderDisplayName {
|
|
|
|
maxLength: number,
|
|
|
|
minLength: number,
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Fake display name to show when data is loading. */
|
|
|
|
const PlaceholderDisplayName: React.FC<IPlaceholderDisplayName> = ({ minLength, maxLength }) => {
|
2022-03-21 11:09:01 -07:00
|
|
|
const length = randomIntFromInterval(maxLength, minLength);
|
|
|
|
const acctLength = randomIntFromInterval(maxLength, minLength);
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
return (
|
2022-03-23 17:18:37 -07:00
|
|
|
<div className='flex flex-col text-slate-200 dark:text-slate-700'>
|
2022-03-21 11:09:01 -07:00
|
|
|
<p>{generateText(length)}</p>
|
|
|
|
<p>{generateText(acctLength)}</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
export default PlaceholderDisplayName;
|