-
- {props.value.id ? (
-
- ) : null}
-
- {
- props.onChange({
- ...props.value,
- data: {
- ...props.value.data,
- text: ev.target.value,
- },
- });
- }}
- placeholder="Option"
- />
-
-
- {
- props.onChange({
- ...props.value,
- data: {
- ...props.value.data,
- img,
- },
- });
- }}
- />
-
- {typeof props.index !== "undefined" &&
- props.groups &&
- props.onMoveToGroup && (
- ({
- label: `Move to ${group || `group ${groupIndex}`}`,
- onClick: () => {
- props.onMoveToGroup &&
- typeof props.index === "number" &&
- props.onMoveToGroup(props.index, groupIndex);
- },
- disabled: groupIndex === props.groupIndex,
- }))}
- />
- )}
-
-
- {props.showValueField && (
-
- {
- props.onChange({
- ...props.value,
- data: {
- ...props.value.data,
- val: ev.target.value,
- },
- });
- }}
- />
-
- )}
-
-
{
- props.onChange({
- ...props.value,
- data: {
- ...props.value.data,
- flag: ev,
- },
- });
- }}
- />
-
- );
-};
diff --git a/editor.planx.uk/src/@planx/components/Question/Editor.tsx b/editor.planx.uk/src/@planx/components/Question/Editor.tsx
index e60f851311..025590803b 100644
--- a/editor.planx.uk/src/@planx/components/Question/Editor.tsx
+++ b/editor.planx.uk/src/@planx/components/Question/Editor.tsx
@@ -10,14 +10,13 @@ import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
-import InputRowItem from "ui/shared/InputRowItem";
import { Switch } from "ui/shared/Switch";
import { InternalNotes } from "../../../ui/editor/InternalNotes";
import { MoreInformation } from "../../../ui/editor/MoreInformation/MoreInformation";
import { BaseNodeData, Option, parseBaseNodeData } from "../shared";
-import { FlagsSelect } from "../shared/FlagsSelect";
import { ICONS } from "../shared/icons";
+import { OptionEditor } from "../shared/OptionsEditor";
interface Props {
node: {
@@ -34,100 +33,6 @@ interface Props {
handleSubmit?: Function;
}
-const OptionEditor: React.FC<{
- value: Option;
- onChange: (newVal: Option) => void;
- showValueField?: boolean;
-}> = (props) => (
-