mirror of
https://github.com/langgenius/dify.git
synced 2025-11-22 07:56:37 +00:00
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: jyong <718720800@qq.com> Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com> Co-authored-by: lyzno1 <yuanyouhuilyz@gmail.com> Co-authored-by: quicksand <quicksandzn@gmail.com> Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com> Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: Hanqing Zhao <sherry9277@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Harry <xh001x@hotmail.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
import { Transition, TransitionChild } from '@headlessui/react'
|
|
import classNames from '@/utils/classnames'
|
|
|
|
type ContentDialogProps = {
|
|
className?: string
|
|
show: boolean
|
|
onClose?: () => void
|
|
children: ReactNode
|
|
}
|
|
|
|
const ContentDialog = ({
|
|
className,
|
|
show,
|
|
onClose,
|
|
children,
|
|
}: ContentDialogProps) => {
|
|
return (
|
|
<Transition
|
|
show={show}
|
|
as='div'
|
|
className='absolute left-0 top-0 z-30 box-border h-full w-full p-2'
|
|
>
|
|
<TransitionChild>
|
|
<div
|
|
className={classNames(
|
|
'absolute inset-0 left-0 w-full bg-app-detail-overlay-bg',
|
|
'duration-300 ease-in data-[closed]:opacity-0',
|
|
'data-[enter]:opacity-100',
|
|
'data-[leave]:opacity-0',
|
|
)}
|
|
onClick={onClose}
|
|
/>
|
|
</TransitionChild>
|
|
|
|
<TransitionChild>
|
|
<div className={classNames(
|
|
'absolute left-0 w-full border-r border-divider-burn bg-app-detail-bg',
|
|
'duration-100 ease-in data-[closed]:-translate-x-full',
|
|
'data-[enter]:translate-x-0 data-[enter]:duration-300 data-[enter]:ease-out',
|
|
'data-[leave]:-translate-x-full data-[leave]:duration-200 data-[leave]:ease-in',
|
|
className,
|
|
)}>
|
|
{children}
|
|
</div>
|
|
</TransitionChild>
|
|
</Transition>
|
|
)
|
|
}
|
|
|
|
export default ContentDialog
|