🎥 Make videos programmatically with React
added infobubble with stacktrace
Patric Salvisberg669db42dc9be
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.tsxindex 551deb6c70..01ecd355c5 100644--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.tsx+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.tsx@@ -2,7 +2,9 @@ import React, {useMemo} from 'react';import type {z} from 'zod';import {FAIL_COLOR} from '../../../helpers/colors';import {useZodIfPossible} from '../../get-zod-if-possible';+import {Spacing} from '../../layout';import {ValidationMessage} from '../../NewComposition/ValidationMessage';+import {InfoBubble} from '../InfoBubble';import {useLocalState} from './local-state';import type {JSONPath} from './zod-types';import type {UpdaterFunction} from './ZodSwitch';@@ -12,6 +14,15 @@ const fullWidth: React.CSSProperties = {width: '100%',};+const stackTrace: React.CSSProperties = {+ fontSize: '10px',+ padding: '10px',+};++const legend: React.CSSProperties = {+ display: 'flex',+};+export const ZodEffectEditor: React.FC<{schema: z.ZodTypeAny;jsonPath: JSONPath;@@ -84,12 +95,20 @@ export const ZodEffectEditor: React.FC<{/></div>{!localValue.zodValidation.success && (- <legend>+ <legend style={legend}><ValidationMessagealign="flex-start"message={localValue.zodValidation.error.format()._errors[0]}type="error"/>+ <Spacing x={0.5} />+ <InfoBubble title="Stack Trace">+ <div style={stackTrace}>+ Zod Validation has failed! <br />+ {localValue.zodValidation.error.stack}+ </div>+ </InfoBubble>+ <Spacing x={0.5} /></legend>)}</fieldset>