import React from 'react'; import { Box } from '../../primitives'; import type { ISkeletonProps } from './props'; import Bones from './Bones'; export const Skeleton = ({ children, isLoaded, ...props }: ISkeletonProps & { circle?: boolean }) => { if (isLoaded) return {children}; const hideChildren = () => { return React.Children.map(children, (child: JSX.Element) => { return React.cloneElement(child, { opacity: 0 }, child.props.children); }); }; return ( {children ? hideChildren() : null} ); };