bigbuffet-rw/app/soapbox/features/placeholder/components/placeholder_display_name.tsx

24 lines
673 B
TypeScript
Raw Normal View History

import React from 'react';
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);
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>
);
};
2022-03-21 11:09:01 -07:00
export default PlaceholderDisplayName;