mango-v4-ui/components/shared/SheenLoader.tsx

24 lines
638 B
TypeScript
Raw Normal View History

2022-07-23 21:27:54 -07:00
import { ReactNode } from 'react'
// Children should be a shape or set of shapes with a bg color to animate over
2022-08-15 04:28:36 -07:00
const SheenLoader = ({
children,
className,
}: {
children: ReactNode
className?: string
}) => {
2022-07-23 21:27:54 -07:00
return (
<div className="flex items-center">
<div
2022-12-05 19:23:22 -08:00
className={`relative rounded-md ${className} overflow-hidden before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_4s_infinite] before:bg-gradient-to-r before:from-transparent before:via-th-bkg-4 before:to-transparent before:opacity-50`}
>
{children}
2022-07-23 21:27:54 -07:00
</div>
</div>
)
}
export default SheenLoader