'use client' import type { App } from '@/types/app' import { cn } from '@langgenius/dify-ui/cn' import { Drawer, DrawerBackdrop, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerPopup, DrawerPortal, DrawerTitle, DrawerViewport, } from '@langgenius/dify-ui/drawer' import { useAtomValue } from 'jotai' import { useTranslation } from 'react-i18next' import TemplateWorkflowEn from '@/app/components/develop/template/template_workflow.en.mdx' import TemplateWorkflowJa from '@/app/components/develop/template/template_workflow.ja.mdx' import TemplateWorkflowZh from '@/app/components/develop/template/template_workflow.zh.mdx' import { useLocale } from '@/context/i18n' import useTheme from '@/hooks/use-theme' import { getDocLanguage } from '@/i18n-config/language' import { AppModeEnum, Theme } from '@/types/app' import { deploymentRouteAppInstanceIdAtom } from '../../../route-state' type PromptVariable = { key: string; name: string } type WorkflowApiDocAppDetail = Pick type WorkflowDocTemplateProps = { appDetail: WorkflowApiDocAppDetail variables: PromptVariable[] inputs: Record } const EMPTY_VARIABLES: PromptVariable[] = [] const EMPTY_INPUTS: Record = {} function WorkflowDocTemplate({ docLanguage, appDetail, variables, inputs, }: WorkflowDocTemplateProps & { docLanguage: string }) { if (docLanguage === 'zh') { return } if (docLanguage === 'ja') { return } return } export function DeveloperApiDocsDrawer({ open, apiBaseUrl, onOpenChange, }: { open: boolean apiBaseUrl: string onOpenChange: (open: boolean) => void }) { const { t } = useTranslation('deployments') const appInstanceId = useAtomValue(deploymentRouteAppInstanceIdAtom) const locale = useLocale() const { theme } = useTheme() const docLanguage = getDocLanguage(locale) if (!appInstanceId) return null const appDetail: WorkflowApiDocAppDetail = { id: appInstanceId, mode: AppModeEnum.WORKFLOW, api_base_url: apiBaseUrl, } return ( $['access.api.docsClose'])} className="absolute top-4 right-5 size-6 rounded-md" />
{t(($) => $['access.api.docsTitle'])} {t(($) => $['access.api.docsDescription'])}
) }