bigbuffet-rw/app/soapbox/features/placeholder/components/placeholder-status-content.tsx

22 lines
597 B
TypeScript
Raw Normal View History

import React from 'react';
import { randomIntFromInterval, generateText } from '../utils';
2022-05-01 10:45:37 -07:00
interface IPlaceholderStatusContent {
maxLength: number,
minLength: number,
}
/** Fake status content while data is loading. */
const PlaceholderStatusContent: React.FC<IPlaceholderStatusContent> = ({ minLength, maxLength }) => {
2022-03-21 11:09:01 -07:00
const length = randomIntFromInterval(maxLength, minLength);
2022-03-21 11:09:01 -07:00
return (
<div className='flex flex-col text-primary-50 dark:text-primary-800'>
2022-03-21 11:09:01 -07:00
<p className='break-words'>{generateText(length)}</p>
</div>
);
};
2022-03-21 11:09:01 -07:00
export default PlaceholderStatusContent;