import React from "react"; import { TaskDefinition, TaskMetadata, } from "../services/WorkflowTemplateService"; import AddTaskButton from "./AddTaskButton"; import { Namespaces } from "../../../../i18n/i18n"; import { useTranslation } from "react-i18next"; interface TaskListProps { tasks: TaskDefinition[]; taskType: string; onChange: (tasks: TaskDefinition[]) => void; } const TaskList: React.FC = ({ tasks, taskType, onChange }) => { const { t: tTaskType } = useTranslation(Namespaces.TaskTypes); const handleAddTask = (selectedType: TaskMetadata) => { const newTask: TaskDefinition = { type: selectedType.taskType, config: { name: tTaskType(selectedType.displayName) }, }; console.log("Add Task clicked"); onChange([...tasks, newTask]); }; return (
    {tasks.map((task, index) => (
  • {task.type}
  • ))}
); }; export default TaskList;