'use client' import { Button } from '@langgenius/dify-ui/button' import { useState } from 'react' import { useTranslation } from 'react-i18next' import SecretKeyModal from '@/app/components/develop/secret-key/secret-key-modal' type ISecretKeyButtonProps = { className?: string appId?: string textCls?: string canManage?: boolean } const SecretKeyButton = ({ className, appId, textCls, canManage = false, }: ISecretKeyButtonProps) => { const [isVisible, setIsVisible] = useState(false) const { t } = useTranslation() return ( <> setIsVisible(true)} size="small" variant="ghost" disabled={!canManage} > {t(($) => $.apiKey, { ns: 'appApi' })} setIsVisible(false)} appId={appId} canManage={canManage} /> > ) } export default SecretKeyButton