import { ZodError } from 'zod' import { pluralize } from '~/utils/text' import { IORenderInstruction } from '~/components/RenderIOCall' export default function ComponentError({ component, error, }: { component?: IORenderInstruction error: Pick }) { return (
{component && ( )}

This {component ? 'field' : 'action'} contains the following{' '} {pluralize(error.issues.length, 'error')}:

Please correct your action code and try again.

) } function pathToString(path: (string | number)[]) { if (path.length === 0) return '' return ( path[0] + path .slice(1) .map(p => `[${p}]`) .join('') ) }