diff --git a/step1-07/src/TodoApp.types.ts b/step1-07/src/TodoApp.types.ts new file mode 100644 index 0000000..eb5437e --- /dev/null +++ b/step1-07/src/TodoApp.types.ts @@ -0,0 +1,10 @@ +export type FilterTypes = 'all' | 'active' | 'completed'; + +export interface TodoItem { + label: string; + completed: boolean; +} + +export interface Todos { + [id: string]: TodoItem; +} diff --git a/step1-07/src/components/TodoFooter.tsx b/step1-07/src/components/TodoFooter.tsx index b36b788..29534a9 100644 --- a/step1-07/src/components/TodoFooter.tsx +++ b/step1-07/src/components/TodoFooter.tsx @@ -1,6 +1,11 @@ import React from 'react'; +import { Todos } from '../TodoApp.types'; +interface TodoFooterProps { + clear: () => void; + todos: Todos; +} -export const TodoFooter = (props: any) => { +export const TodoFooter = (props: TodoFooterProps) => { const itemCount = Object.keys(props.todos).filter(id => !props.todos[id].completed).length; return (