dify/web/app/components/plugins/readme-panel/index.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

37 lines
832 B
TypeScript

'use client'
import { ReadmeDialog } from './dialog'
import { ReadmeDrawer } from './drawer'
import { useReadmePanelStore } from './store'
export default function ReadmePanel() {
const currentPanel = useReadmePanelStore((s) => s.currentPanel)
const closeReadmePanel = useReadmePanelStore((s) => s.closeReadmePanel)
if (!currentPanel) return null
const onOpenChange = (open: boolean) => {
if (!open) closeReadmePanel()
}
if (currentPanel.presentation === 'dialog') {
return (
<ReadmeDialog
detail={currentPanel.detail}
open
onOpenChange={onOpenChange}
triggerId={currentPanel.triggerId}
/>
)
}
return (
<ReadmeDrawer
detail={currentPanel.detail}
open
onOpenChange={onOpenChange}
triggerId={currentPanel.triggerId}
/>
)
}