/
githubmirror
/
redux
Обзор
Документация
Войти
/
githubmirror
/
redux
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/todomvc/src/components/MainSection.js
36 строк
930 B
Tim Dorr
Format the examples
20 мар 2024, 19:52
Не верифицирован
20 мар 2024, 19:52
3085048
Код
Авторство
О чём код?
import React from 'react' import PropTypes from 'prop-types' import Footer from './Footer' import VisibleTodoList from '../containers/VisibleTodoList' const MainSection = ({ todosCount, completedCount, actions }) => ( <section className="main"> {!!todosCount && ( <span> <input className="toggle-all" type="checkbox" checked={completedCount === todosCount} readOnly /> <label onClick={actions.completeAllTodos} /> </span> )} <VisibleTodoList /> {!!todosCount && ( <Footer completedCount={completedCount} activeCount={todosCount - completedCount} onClearCompleted={actions.clearCompleted} /> )} </section> ) MainSection.propTypes = { todosCount: PropTypes.number.isRequired, completedCount: PropTypes.number.isRequired, actions: PropTypes.object.isRequired } export default MainSection