mirror of
https://github.com/langgenius/dify.git
synced 2026-07-24 21:18:35 +08:00
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
'use client'
|
|
|
|
import type { PluginDetail } from '../types'
|
|
import { Dialog, DialogCloseButton, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { ReadmePanelContent } from './content'
|
|
|
|
type ReadmeDialogProps = {
|
|
detail: PluginDetail
|
|
open: boolean
|
|
onOpenChange: (open: boolean) => void
|
|
triggerId?: string
|
|
}
|
|
|
|
export function ReadmeDialog({ detail, open, onOpenChange, triggerId }: ReadmeDialogProps) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange} triggerId={triggerId}>
|
|
<DialogContent className="h-[calc(100dvh-16px)] w-full max-w-200 overflow-hidden p-0">
|
|
<ReadmePanelContent
|
|
detail={detail}
|
|
title={
|
|
<DialogTitle className="truncate text-xs font-medium text-text-tertiary uppercase">
|
|
{t(($) => $['readmeInfo.title'], { ns: 'plugin' })}
|
|
</DialogTitle>
|
|
}
|
|
closeButton={
|
|
<DialogCloseButton
|
|
aria-label={t(($) => $['operation.close'], { ns: 'common' })}
|
|
className="static size-8 rounded-lg"
|
|
/>
|
|
}
|
|
/>
|
|
</DialogContent>
|
|
</Dialog>
|
|
)
|
|
}
|