1import { PanelPlugin } from '@grafana/data';
2
3import { TextPanel } from './TextPanel';
4import { textPanelMigrationHandler } from './textPanelMigrationHandler';
5import { TextPanelEditor } from './TextPanelEditor';
6import { defaultPanelOptions, PanelOptions, TextMode } from './models.gen';
7
8export const plugin = new PanelPlugin<PanelOptions>(TextPanel)
9  .setPanelOptions((builder) => {
10    builder
11      .addRadio({
12        path: 'mode',
13        name: 'Mode',
14        description: 'text mode of the panel',
15        settings: {
16          options: [
17            { value: TextMode.Markdown, label: 'Markdown' },
18            { value: TextMode.HTML, label: 'HTML' },
19          ],
20        },
21        defaultValue: defaultPanelOptions.mode,
22      })
23      .addCustomEditor({
24        id: 'content',
25        path: 'content',
26        name: 'Content',
27        description: 'Content of the panel',
28        editor: TextPanelEditor,
29        defaultValue: defaultPanelOptions.content,
30      });
31  })
32  .setMigrationHandler(textPanelMigrationHandler);
33