import React from 'react'; import { Alert, Input, Radio, Space, Tag, Typography } from 'antd'; import type { JsonValue, VideoPromptSchemaFieldConfig, VideoPromptSchemaSectionConfig, } from '../utils/videoPromptSchema'; import { clonePlain, hasSchemaConfigSnapshot, normalizeSchemaSections, setArrayObjectField, setObjectField, shouldUseSchemaTextArea, stringifySchemaValue, } from '../utils/videoPromptSchema'; const { Text } = Typography; const { TextArea } = Input; type VideoPromptSchemaEditorProps = { value: Record; schemaConfigSnapshot?: Record | null; onChange: (nextValue: Record) => void; }; function isRecord(value: unknown): value is Record { return !!value && typeof value === 'object' && !Array.isArray(value); } function ReadonlyBlock({ value }: { value: JsonValue }) { const text = value === 'true' ? '是' : value === 'false' ? '否' : stringifySchemaValue(value); return shouldUseSchemaTextArea(value) ? (