diff --git a/src/components/task-row.tsx b/src/components/task-row.tsx index ad8de6d..a01fbe5 100644 --- a/src/components/task-row.tsx +++ b/src/components/task-row.tsx @@ -2,7 +2,7 @@ import { useState } from 'react' import { taskTypes, taskStatuses } from './consts'; import { EnumSelect } from './enum-select'; -export function TaskRow({ task, updateTask, deleteTask, orderTasks }: { task: TodoTask, updateTask: (task: TodoTask) => void, deleteTask: (id: number) => void, orderTasks: (from: number, to: number) => void }): JSX.Element { +export function TaskRow({ task, updateTask, deleteTask, orderTasks }: TaskProps & { task: TodoTask }) { const [edit, setEdit] = useState(false); const [classnames, setClassnames] = useState([]); diff --git a/src/components/task-table.tsx b/src/components/task-table.tsx index ab8147a..a4332df 100644 --- a/src/components/task-table.tsx +++ b/src/components/task-table.tsx @@ -1,7 +1,7 @@ import { } from 'react' import { TaskRow } from './task-row'; -export function TaskTable({ tasks, ...rest }: { tasks: TodoTasks, updateTask: (task: TodoTask) => void, deleteTask: (id: number) => void, orderTasks: (from: number, to: number) => void }): JSX.Element { +export function TaskTable({ tasks, ...rest }: TaskProps & { tasks: TodoTasks }) { return (
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 6723c91..afab525 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -2,12 +2,16 @@ type TaskType = 'task' | 'bug'; type TaskStatus = 'paused' | 'in progress' | 'testing' | 'released'; -class TodoTask { - id: number; - type: TaskType; - title: string; - status: TaskStatus; +interface TodoTask { + id: number; + type: TaskType; + title: string; + status: TaskStatus; } - type TodoTasks = TodoTask[]; +interface TaskProps { + updateTask: (task: TodoTask) => void; + deleteTask: (id: number) => void; + orderTasks: (from: number, to: number) => void; +}