mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 10:12:43 +08:00
Signed-off-by: yyh <yuanyouhuilyz@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Coding On Star <447357187@qq.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: -LAN- <laipz8200@outlook.com> Co-authored-by: statxc <tyleradams93226@gmail.com>
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
import { useCallback } from 'react'
|
|
import { Dialog, DialogContent } from '@/app/components/base/ui/dialog'
|
|
import { cn } from '@/utils/classnames'
|
|
|
|
type DialogProps = {
|
|
className?: string
|
|
children: ReactNode
|
|
show: boolean
|
|
onClose?: () => void
|
|
}
|
|
|
|
const MenuDialog = ({
|
|
className,
|
|
children,
|
|
show,
|
|
onClose,
|
|
}: DialogProps) => {
|
|
const close = useCallback(() => onClose?.(), [onClose])
|
|
|
|
return (
|
|
<Dialog
|
|
open={show}
|
|
onOpenChange={(open) => {
|
|
if (!open)
|
|
close()
|
|
}}
|
|
>
|
|
<DialogContent
|
|
overlayClassName="bg-transparent"
|
|
className={cn(
|
|
'left-0 top-0 h-full max-h-none w-full max-w-none translate-x-0 translate-y-0 overflow-hidden rounded-none border-none bg-background-sidenav-bg p-0 shadow-none backdrop-blur-md',
|
|
className,
|
|
)}
|
|
>
|
|
<div className="absolute right-0 top-0 h-full w-1/2 bg-components-panel-bg" />
|
|
{children}
|
|
</DialogContent>
|
|
</Dialog>
|
|
)
|
|
}
|
|
|
|
export default MenuDialog
|