import type { RenderConfigScreenCtx } from "datocms-plugin-sdk"; import { Button, Canvas, FieldGroup, Form, SwitchField, TextareaField, TextField, } from "datocms-react-ui"; import { Form as FormHandler, Field } from "react-final-form"; import styles from "./styles.module.css"; interface PropTypes { ctx: RenderConfigScreenCtx; } // config object starts empty interface FreshInstallationParameters {} // save user input interface ValidParameters { buttonText: string; buttonLink: string; panelLocation: string; sectionDescription: string; sectionTitle: string; isWebhook: boolean; } // parameters can be empty or filled in type Parameters = FreshInstallationParameters | ValidParameters; export default function ConfigScreen({ ctx }: PropTypes) { const parameters = ctx.plugin.attributes.parameters; console.log("parameters", parameters); return ( initialValues={parameters.values as ValidParameters} onSubmit={async (values) => { await ctx.updatePluginParameters({ values }); ctx.notice("Settings updated successfully!"); }} > {({ handleSubmit, submitting, dirty }) => (
{({ input, meta: { error } }) => ( )} {({ input, meta: { error } }) => ( )}
{({ input, meta: { error } }) => ( )} {({ input, meta: { error } }) => ( )} {({ input, meta: { error } }) => ( )}
{({ input, meta: { error } }) => (

Comma separated list of model ID where sidebar panel should display.

Example:{" "} component_form, template_page.

Input string{" "} global{" "} to display the panel globally.

} textInputProps={{ monospaced: true }} error={error} {...input} /> )}
)}
); }