/* 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 { I18N_TECHNICAL_TEXT } from '../../../i18n/technicalText.js'; import React from 'react'; import { Button, Drawer, Tag } from 'antd'; import { useTranslation } from 'react-i18next'; /** * 原型 .sm-detail-drawer:Ant Design Drawer(620px,窄屏 100vw),正文为描述 + 来源 / 标签 / 适用场景 / * 触发词分节与更新时间,页脚「关闭」+ 页面已有操作。children 插在来源之后(如企业治理参考)。 * Portal 挂 .sm-theme 并复用页面的主题变量(themeStyle),不新增 ConfigProvider。 */ const SkillDetailDrawer = ({ skill, open, onClose, sourceText, tagLabel, themeStyle, actions = null, children = null, }) => { const { t, i18n } = useTranslation(); return ( {actions} ) : null } mask={{ closable: true }} > {skill ? ( <>

{skill.description}

{t('来源')}

{sourceText} · {skill.canonical_id}{' '} {I18N_TECHNICAL_TEXT.VERSION_PREFIX} {skill.version_no}

{children} {skill.tags?.length ? (

{t('标签')}

{skill.tags.map((tag) => ( {tagLabel(tag)} ))}
) : null} {skill.scenarios?.length ? (

{t('适用场景')}

    {skill.scenarios.map((item) => (
  • {item}
  • ))}
) : null} {skill.triggers?.length ? (

{t('触发词')}

{t('任务描述中出现这些词时,该技能会自动生效。')}

{skill.triggers.map((item) => ( {item} ))}
) : null}
{t('更新时间')}: {skill.updated_at ? new Date(skill.updated_at * 1000).toLocaleString(i18n.language) : '-'}
) : null}
); }; export default SkillDetailDrawer;