File size: 1,686 Bytes
f0499d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { PluginConfig } from "../store";

import Locale from "../locales";
import { ListItem } from "./ui-lib";

export function PluginConfigList(props: {
  pluginConfig: PluginConfig;
  updateConfig: (updater: (config: PluginConfig) => void) => void;
}) {
  return (
    <>
      <ListItem
        title={Locale.Settings.Plugin.Enable.Title}
        subTitle={Locale.Settings.Plugin.Enable.SubTitle}
      >
        <input
          type="checkbox"
          checked={props.pluginConfig.enable}
          onChange={(e) =>
            props.updateConfig(
              (config) => (config.enable = e.currentTarget.checked),
            )
          }
        ></input>
      </ListItem>
      <ListItem
        title={Locale.Settings.Plugin.MaxIteration.Title}
        subTitle={Locale.Settings.Plugin.MaxIteration.SubTitle}
      >
        <input
          type="number"
          min={1}
          max={10}
          value={props.pluginConfig.maxIterations}
          onChange={(e) =>
            props.updateConfig(
              (config) =>
                (config.maxIterations = e.currentTarget.valueAsNumber),
            )
          }
        ></input>
      </ListItem>
      <ListItem
        title={Locale.Settings.Plugin.ReturnIntermediateStep.Title}
        subTitle={Locale.Settings.Plugin.ReturnIntermediateStep.SubTitle}
      >
        <input
          type="checkbox"
          checked={props.pluginConfig.returnIntermediateSteps}
          onChange={(e) =>
            props.updateConfig(
              (config) =>
                (config.returnIntermediateSteps = e.currentTarget.checked),
            )
          }
        ></input>
      </ListItem>
    </>
  );
}