import type { CellPlugin } from '@react-page/editor'; import React from 'react'; import { Timeline } from 'react-twitter-widgets'; type Data = { screenName: string; height: number; title: string; }; // you can pass the shape of the data as the generic type argument const customContentPluginTwitter: CellPlugin = { Renderer: ({ data }) => (

{data.title}

), id: 'twitter-timeline', title: 'Twitter timeline', description: 'A twitter timeline', version: 1, controls: { type: 'autoform', schema: { // this JSONschema is type checked against the generic type argument // the autocompletion of your IDE helps to create this schema properties: { title: { type: 'string', default: 'A Sample Twitter plugin', }, screenName: { type: 'string', default: 'typescript', }, height: { type: 'number', default: 600, }, }, required: ['screenName'], }, }, }; export default customContentPluginTwitter;