index.tsx 574 B

1234567891011121314151617181920212223
  1. 'use client'
  2. import Drawer from '@/app/components/base/drawer'
  3. import type { IDrawerProps } from '@/app/components/base/drawer'
  4. type IFloatRightContainerProps = {
  5. isMobile: boolean
  6. children?: React.ReactNode
  7. } & IDrawerProps
  8. const FloatRightContainer = ({ isMobile, children, isOpen, ...drawerProps }: IFloatRightContainerProps) => {
  9. return (
  10. <>
  11. {isMobile && (
  12. <Drawer isOpen={isOpen} {...drawerProps}>{children}</Drawer>
  13. )}
  14. {(!isMobile && isOpen) && (
  15. <>{children}</>
  16. )}
  17. </>
  18. )
  19. }
  20. export default FloatRightContainer