header-wrapper.tsx 685 B

123456789101112131415161718192021222324252627
  1. 'use client'
  2. import { usePathname } from 'next/navigation'
  3. import s from './index.module.css'
  4. import classNames from '@/utils/classnames'
  5. type HeaderWrapperProps = {
  6. children: React.ReactNode
  7. }
  8. const HeaderWrapper = ({
  9. children,
  10. }: HeaderWrapperProps) => {
  11. const pathname = usePathname()
  12. const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools', '/account'].includes(pathname)
  13. return (
  14. <div className={classNames(
  15. 'sticky top-0 left-0 right-0 z-30 flex flex-col 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