mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
31 lines
724 B
TypeScript
31 lines
724 B
TypeScript
'use client'
|
|
|
|
import { cn } from '@/utils/classnames'
|
|
import PluginTypeSwitch from './plugin-type-switch'
|
|
import SearchBoxWrapper from './search-box/search-box-wrapper'
|
|
|
|
type StickySearchAndSwitchWrapperProps = {
|
|
pluginTypeSwitchClassName?: string
|
|
}
|
|
|
|
const StickySearchAndSwitchWrapper = ({
|
|
pluginTypeSwitchClassName,
|
|
}: StickySearchAndSwitchWrapperProps) => {
|
|
const hasCustomTopClass = pluginTypeSwitchClassName?.includes('top-')
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'mt-4 bg-background-body',
|
|
hasCustomTopClass && 'sticky z-10',
|
|
pluginTypeSwitchClassName,
|
|
)}
|
|
>
|
|
<SearchBoxWrapper />
|
|
<PluginTypeSwitch />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default StickySearchAndSwitchWrapper
|