HeaderWrapper.tsx 647 B

12345678910111213141516171819202122232425262728
  1. 'use client'
  2. import classNames from 'classnames'
  3. import { usePathname } from 'next/navigation'
  4. import s from './index.module.css'
  5. type HeaderWrapperProps = {
  6. children: React.ReactNode
  7. }
  8. const HeaderWrapper = ({
  9. children,
  10. }: HeaderWrapperProps) => {
  11. const pathname = usePathname()
  12. const isBordered = ['/apps', '/datasets'].includes(pathname)
  13. return (
  14. <div className={classNames(
  15. 'sticky top-0 left-0 right-0 z-20 flex flex-col bg-gray-100 grow-0 shrink-0 basis-auto min-h-[56px]',
  16. s.header,
  17. isBordered ? 'border-b border-gray-200' : '',
  18. )}
  19. >
  20. {children}
  21. </div>
  22. )
  23. }
  24. export default HeaderWrapper