dify/web/app/components/header/account-setting/menu-dialog.tsx
盐粒 Yanli 8732d1463a
chore(agent-v2): sync nightly updates to main (2026-06-18) (#37610)
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
2026-06-18 15:34:51 +00:00

45 lines
1.1 KiB
TypeScript

import type { ReactNode } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'
import { useCallback } from 'react'
type DialogProps = {
backdropClassName?: string
className?: string
children: ReactNode
show: boolean
onClose?: () => void
}
const MenuDialog = ({
backdropClassName,
className,
children,
show,
onClose,
}: DialogProps) => {
const close = useCallback(() => onClose?.(), [onClose])
return (
<Dialog
open={show}
onOpenChange={(open) => {
if (!open)
close()
}}
>
<DialogContent
backdropClassName={cn('z-40 bg-transparent', backdropClassName)}
className={cn(
'top-0 left-0 z-40 h-full max-h-none w-full max-w-none translate-x-0 translate-y-0 scale-100 overflow-hidden rounded-none border-none bg-background-sidenav-bg p-0 shadow-none backdrop-blur-md transition-opacity data-ending-style:scale-100 data-starting-style:scale-100',
className,
)}
>
{children}
</DialogContent>
</Dialog>
)
}
export default MenuDialog