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 { taskTypes, taskStatuses } from './consts';
|
||||||
import { EnumSelect } from './enum-select';
|
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 [edit, setEdit] = useState(false);
|
||||||
const [classnames, setClassnames] = useState<string[]>([]);
|
const [classnames, setClassnames] = useState<string[]>([]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { } from 'react'
|
import { } from 'react'
|
||||||
import { TaskRow } from './task-row';
|
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 (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="tr">
|
<div className="tr">
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,16 @@
|
||||||
|
|
||||||
type TaskType = 'task' | 'bug';
|
type TaskType = 'task' | 'bug';
|
||||||
type TaskStatus = 'paused' | 'in progress' | 'testing' | 'released';
|
type TaskStatus = 'paused' | 'in progress' | 'testing' | 'released';
|
||||||
class TodoTask {
|
interface TodoTask {
|
||||||
id: number;
|
id: number;
|
||||||
type: TaskType;
|
type: TaskType;
|
||||||
title: string;
|
title: string;
|
||||||
status: TaskStatus;
|
status: TaskStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
type TodoTasks = TodoTask[];
|
type TodoTasks = TodoTask[];
|
||||||
|
|
||||||
|
interface TaskProps {
|
||||||
|
updateTask: (task: TodoTask) => void;
|
||||||
|
deleteTask: (id: number) => void;
|
||||||
|
orderTasks: (from: number, to: number) => void;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue