mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
46 lines
1006 B
TypeScript
46 lines
1006 B
TypeScript
import React from 'react'
|
|
import Drawer from './drawer'
|
|
import cn from '@/utils/classnames'
|
|
import { noop } from 'lodash-es'
|
|
|
|
type IFullScreenDrawerProps = {
|
|
isOpen: boolean
|
|
onClose?: () => void
|
|
fullScreen: boolean
|
|
showOverlay?: boolean
|
|
needCheckChunks?: boolean
|
|
modal?: boolean
|
|
}
|
|
|
|
const FullScreenDrawer = ({
|
|
isOpen,
|
|
onClose = noop,
|
|
fullScreen,
|
|
children,
|
|
showOverlay = true,
|
|
needCheckChunks = false,
|
|
modal = false,
|
|
}: React.PropsWithChildren<IFullScreenDrawerProps>) => {
|
|
return (
|
|
<Drawer
|
|
open={isOpen}
|
|
onClose={onClose}
|
|
panelClassName={cn(
|
|
fullScreen
|
|
? 'w-full'
|
|
: 'w-[568px] pb-2 pr-2 pt-16',
|
|
)}
|
|
panelContentClassName={cn(
|
|
'bg-components-panel-bg',
|
|
!fullScreen && 'rounded-xl border-[0.5px] border-components-panel-border',
|
|
)}
|
|
showOverlay={showOverlay}
|
|
needCheckChunks={needCheckChunks}
|
|
modal={modal}
|
|
>
|
|
{children}
|
|
</Drawer>)
|
|
}
|
|
|
|
export default FullScreenDrawer
|