import * as React from "react" import { SHOW_ACTIVE, SHOW_ALL, SHOW_COMPLETED } from "../const" import Footer from "./footer" import TodoItem from "./todo-item" const TODO_FILTERS = { [SHOW_ALL]: () => true, [SHOW_ACTIVE]: (todo: any) => !todo.completed, [SHOW_COMPLETED]: (todo: any) => todo.completed } export default class MainSection extends React.PureComponent { public state = { filter: SHOW_ALL } public handleClearCompleted = () => { this.props.actions.clearCompleted() } public handleShow = (filter: any) => { this.setState({ filter }) } public renderToggleAll(completedCount: number) { const { todos, actions } = this.props if (todos.length > 0) { return ( ) } } public renderFooter(completedCount: number) { const { todos } = this.props const { filter } = this.state const activeCount = todos.length - completedCount if (todos.length) { return (