LoadingOpacity.tsx 447 B

12345678910111213141516171819202122232425
  1. import { PropsWithChildren } from 'react'
  2. const LoadingOpacity = ({
  3. children,
  4. active,
  5. className,
  6. }: PropsWithChildren<{
  7. children?: React.ReactNode
  8. active: boolean
  9. className?: string
  10. }>) => {
  11. return (
  12. <div
  13. className={[
  14. className,
  15. 'flex h-full grow transition-opacity ',
  16. active ? 'opacity-30' : 'opacity-100',
  17. ].join(' ')}
  18. >
  19. {children}
  20. </div>
  21. )
  22. }
  23. export default LoadingOpacity