dify/web/app/components/datasets/documents/detail/completed/common/full-screen-drawer.tsx
yyh 8f93bb36ba
feat(dify-ui): add drawer (#35917)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-08 08:53:32 +00:00

40 lines
1018 B
TypeScript

import type { ReactNode } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
import { noop } from 'es-toolkit/function'
import { CompletedDrawer } from './drawer'
type DocumentDetailDrawerProps = {
open: boolean
onClose?: () => void
fullScreen: boolean
modal?: boolean
children: ReactNode
}
export function DocumentDetailDrawer({
open,
onClose = noop,
fullScreen,
children,
modal = false,
}: DocumentDetailDrawerProps) {
return (
<CompletedDrawer
open={open}
onClose={onClose}
panelClassName={cn(
fullScreen
? 'w-full data-[swipe-direction=left]:w-full data-[swipe-direction=right]:w-full'
: 'w-[568px] pt-16 pr-2 pb-2 data-[swipe-direction=left]:w-[568px] data-[swipe-direction=right]:w-[568px]',
)}
panelContentClassName={cn(
'bg-components-panel-bg',
!fullScreen && 'rounded-xl border-[0.5px] border-components-panel-border',
)}
modal={modal}
>
{children}
</CompletedDrawer>
)
}