diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 6e467a7ad..09cb9702d 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import classNames from 'classnames'; import { Todo } from '../../types/Todo'; -import cn from 'classnames'; import { Filter } from '../../types/Filter'; -import { Error } from '../../types/Error'; import { deleteTodo } from '../../api/todos'; +import { Error } from '../../types/Error'; -interface Props { +type Props = { setTodos: React.Dispatch>; activeTodos: Todo[]; completedTodos: Todo[]; @@ -13,18 +13,18 @@ interface Props { setErrorMessage: React.Dispatch>; setFilter: (filter: Filter) => void; setDeletingTodoIds: React.Dispatch>; -} +}; export const Footer: React.FC = ({ + setTodos, activeTodos, completedTodos, - setFilter, - filter, - setTodos, setErrorMessage, + filter, + setFilter, setDeletingTodoIds, }) => { - const handleClearCompleted = async () => { + async function handleClearCompleted() { const completedTodoIds = completedTodos.map(todo => todo.id); setDeletingTodoIds(completedTodoIds); @@ -55,7 +55,7 @@ export const Footer: React.FC = ({ } setDeletingTodoIds([]); - }; + } return (