import { RenderConfigScreenCtx } from 'datocms-plugin-sdk' import { Canvas, TextField, Button } from 'datocms-react-ui' import s from './styles.module.css' import { useState } from 'react' // this is how we want to save our settings type ValidParameters = { orgId: string; apiKey: string } // parameters can be either empty or filled in type Parameters = ValidParameters type Props = { ctx: RenderConfigScreenCtx } export default function ConfigScreen({ ctx }: Props) { const parameters = ctx.plugin.attributes.parameters as Parameters // Props const [orgId, setOrgId] = useState(parameters.orgId) const [apiKey, setApiKey] = useState(parameters.apiKey) const handleSave = () => { const newParameters: ValidParameters = { orgId, apiKey, } ctx.updatePluginParameters(newParameters) } return (

Welcome to the Raster Plugin!

{/* Organization ID */}
setOrgId(newValue)} />
{/* API Key */}
setApiKey(newValue)} />
{/* Submit changes */}
) }