index.tsx 408 B

12345678910111213141516171819202122232425
  1. import React from 'react';
  2. import { Element } from './styled';
  3. export type Props = {
  4. variant: 'text' | 'rect' | 'circle';
  5. height?: number | string;
  6. width?: number | string;
  7. };
  8. const Skeleton: React.FC<Props> = ({
  9. variant = 'text',
  10. height = 'auto',
  11. width = 'auto',
  12. }: Props) => (
  13. <Element
  14. variant={variant}
  15. style={{
  16. height,
  17. width,
  18. }}
  19. />
  20. );
  21. export default Skeleton;