12 |
13 |
Luffy
14 |
Todos done
15 |
16 | Keep working hard
17 |
18 |
19 |
20 |
21 | {completedTodosCount}/{todosCount}
22 |
23 |
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/src/providers/TodoContext.tsx:
--------------------------------------------------------------------------------
1 | import type { Action } from '../reducers/todo'
2 | import type { Todo } from '../schemas/todos'
3 | import type { ReactNode, Dispatch } from 'react'
4 |
5 | import { createContext, useReducer } from 'react'
6 |
7 | import { todoReducer } from '../reducers/todo'
8 |
9 | export type State = {
10 | todos: Array