import { RenderConfigScreenCtx } from 'datocms-plugin-sdk' import { Button, Canvas, TextField, Form, FieldGroup } from 'datocms-react-ui' import { Form as FormHandler, Field } from 'react-final-form' type Props = { ctx: RenderConfigScreenCtx } export default function ConfigScreen({ ctx }: Props) { return ( { const errors: Record = {} if (!values.backendUrl) { errors.backendUrl = 'This field is required!' } if (!values.channel) { errors.channel = 'This field is required!' } return errors }} /* eslint-disable @typescript-eslint/no-explicit-any*/ onSubmit={async (values: any) => { await ctx.updatePluginParameters(values) ctx.notice('Settings updated successfully!') }} > {({ handleSubmit, submitting, dirty }: any) => (
{/* Set Saleor Backend Url */} {({ input, meta: { error } }) => ( )} {/* Set Saleor Channel */} {({ input, meta: { error } }) => ( )} {/* Set Token */} {({ input, meta: { error } }) => ( )}
)}
) }