import { Button } from '@langgenius/dify-ui/button' import { PopoverClose } from '@langgenius/dify-ui/popover' import { StatusDot } from '@langgenius/dify-ui/status-dot' import * as React from 'react' import { useTranslation } from 'react-i18next' import CopyFeedback from '@/app/components/base/copy-feedback' import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url' import Link from '@/next/link' type CardProps = { apiBaseUrl: string onOpenSecretKeyModal: () => void canManageSecretKey?: boolean } const Card = ({ apiBaseUrl, onOpenSecretKeyModal, canManageSecretKey = false }: CardProps) => { const { t } = useTranslation() const apiReferenceUrl = useDatasetApiAccessUrl() return (
{t(($) => $['serviceApi.card.title'], { ns: 'dataset' })}
{t(($) => $['serviceApi.enabled'], { ns: 'dataset' })}
{t(($) => $['serviceApi.card.endpoint'], { ns: 'dataset' })}
{apiBaseUrl}
{/* Actions */}
{t(($) => $['serviceApi.card.apiKey'], { ns: 'dataset' })} } />
) } export default React.memo(Card)