TaskProps interface
This commit is contained in:
parent
b9686aed78
commit
5bb5ffef17
|
|
@ -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<string[]>([]);
|
||||
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className="w-full">
|
||||
<div className="tr">
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue