2023-07-18 16:57:14 +08:00
|
|
|
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
|
|
import s from './index.module.css'
|
2024-07-09 15:05:40 +08:00
|
|
|
import classNames from '@/utils/classnames'
|
2023-07-18 16:57:14 +08:00
|
|
|
|
|
|
|
type HeaderWrapperProps = {
|
|
|
|
children: React.ReactNode
|
|
|
|
}
|
|
|
|
|
|
|
|
const HeaderWrapper = ({
|
|
|
|
children,
|
|
|
|
}: HeaderWrapperProps) => {
|
|
|
|
const pathname = usePathname()
|
2024-10-12 23:49:18 +08:00
|
|
|
const isBordered = ['/apps', '/datasets', '/datasets/create', '/tools', '/account'].includes(pathname)
|
2023-07-18 16:57:14 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classNames(
|
2024-07-23 17:11:02 +08:00
|
|
|
'sticky top-0 left-0 right-0 z-30 flex flex-col grow-0 shrink-0 basis-auto min-h-[56px]',
|
2023-07-18 16:57:14 +08:00
|
|
|
s.header,
|
|
|
|
isBordered ? 'border-b border-gray-200' : '',
|
|
|
|
)}
|
|
|
|
>
|
2023-11-27 11:47:48 +08:00
|
|
|
{children}
|
2023-07-18 16:57:14 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
export default HeaderWrapper
|