/* Copyright (C) 2025 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ import React from 'react'; import { Button, Progress, Tag, Timeline, Typography } from '@douyinfe/semi-ui'; import { IconAlertTriangle, IconCheckCircleStroked, IconFile, IconHistory, IconLink, } from '@douyinfe/semi-icons'; import { useTranslation } from 'react-i18next'; import OrgPanel from '../../pages/Organization/components/OrgPanel'; import OrgSideSheet from '../../pages/Organization/components/OrgSideSheet'; import OrgStateBlock from '../../pages/Organization/components/OrgStateBlock'; import { getSkillTagToken } from './tokens'; import './skill-components.css'; const { Text, Title, Paragraph } = Typography; const SemanticTag = ({ value, fallback, className = '' }) => { const { t } = useTranslation(); const token = getSkillTagToken(value); return ( {t(fallback || token.label)} ); }; export const SkillStatusTag = ({ status }) => ; export const AssignmentModeTag = ({ mode }) => ; export const ActivationModeTag = ({ mode }) => ; export const ScopeSourceBadge = ({ source, detail }) => { const { t } = useTranslation(); return ( {t(source || '企业默认')} ); }; export const LicenseBadge = ({ expression, decision }) => ( ); export const RiskBadge = ({ conclusion }) => ( ); export const CapabilityTags = ({ capabilities = [] }) => ( {capabilities.map((capability) => ( {capability} ))} ); export const SkillCard = ({ skill, selected = false, onClick, actions }) => { const definition = skill?.definition || skill || {}; const version = skill?.version || {}; const locale = skill?.locales?.find((item) => item.locale === 'zh') || skill?.locales?.[0] || {}; return ( ); }; export const VersionTimeline = ({ versions = [], renderActions }) => { const { t } = useTranslation(); return ( {versions.map((version) => ( {t('版本')} {version.version_no} · {version.content_hash?.slice(-8)} {renderActions ? ( {renderActions(version)} ) : null} ))} ); }; export const GrayscaleProgress = ({ percent = 0, label }) => (
{label && {label}}
); export const SkillDetailSideSheet = ({ visible, onCancel, title, children, footer, }) => ( {children} ); export const SkillEmptyGuide = ({ title, description, actionLabel, onAction, }) => ( {actionLabel} ) : undefined } /> ); export const RunStepTimeline = ({ steps = [] }) => ( {steps.map((step) => ( {step.name || step.type} · {step.status} ))} ); export const StreamOutputPanel = ({ content, streaming = false }) => { const { t } = useTranslation(); return (
{content || ''}
); }; export const ArtifactCard = ({ artifact, onPreview, onDownload }) => { const { t } = useTranslation(); return (
{artifact?.name || artifact?.artifact_type || 'artifact'} {artifact?.content_type} {onPreview && ( )} {onDownload && }
); }; export const MatchedSkillExplain = ({ skill, reason }) => (
{skill} {reason}
); export const ConfirmActionCard = ({ title, summary, parameters, onConfirm, onReject, loading, }) => { const { t } = useTranslation(); return (
{title} {summary}
{t('操作参数')}
{JSON.stringify(parameters || {}, null, 2)}
); };