Centralize task types

This commit is contained in:
AbdBarho
2023-01-10 16:20:48 +09:00
committed by Keith Stevens
parent aa22ed0d1c
commit 97c1f12e11
28 changed files with 163 additions and 188 deletions
+1 -6
View File
@@ -1,15 +1,10 @@
import { Grid } from "@chakra-ui/react";
import { forwardRef, useColorMode } from "@chakra-ui/react";
import { useMemo } from "react";
import { Message } from "src/types/Conversation";
import { FlaggableElement } from "./FlaggableElement";
export interface Message {
text: string;
is_assistant: boolean;
message_id: string;
}
export interface ValidLabel {
name: string;
display_text: string;
+3 -2
View File
@@ -3,13 +3,14 @@ import { Messages } from "src/components/Messages";
import { TaskControls } from "src/components/Survey/TaskControls";
import { TrackedTextarea } from "src/components/Survey/TrackedTextarea";
import { TwoColumnsWithCards } from "src/components/Survey/TwoColumnsWithCards";
import { TaskType } from "src/components/Tasks/TaskTypes";
import {} from "src/components/Tasks/TaskTypes";
import { TaskType } from "./TaskTypes";
export interface CreateTaskProps {
// we need a task type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tasks: any[];
taskType: TaskType;
taskType: TaskInfo;
trigger: (update: { id: string; update_type: string; content: { text: string } }) => void;
onSkipTask: (task: { id: string }, reason: string) => void;
onNextTask: () => void;
+2 -2
View File
@@ -4,7 +4,7 @@ export enum TaskCategory {
Label = "Label",
}
export interface TaskType {
export interface TaskInfo {
label: string;
desc: string;
category: TaskCategory;
@@ -14,7 +14,7 @@ export interface TaskType {
instruction?: string;
}
export const TaskTypes: TaskType[] = [
export const TaskTypes: TaskInfo[] = [
// create
{
label: "Create Initial Prompts",