/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import type { SnippetModule } from '../../types'; import { JSBlockRunJSContext } from '../../../contexts/JSBlockRunJSContext'; const snippet: SnippetModule = { contexts: [JSBlockRunJSContext], prefix: 'sn-jsb-info-card', label: 'Render record info card', description: 'Display current record information in an Ant Design card', locales: { 'zh-CN': { label: '渲染记录信息卡片', description: '使用 Ant Design 卡片显示当前记录的关键信息', }, }, content: ` const { Card, Descriptions, Tag } = ctx.libs.antd; if (!ctx.record) { ctx.render('