mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
15 lines
390 B
TypeScript
15 lines
390 B
TypeScript
import React from 'react';
|
|
import { Todos } from '../TodoApp.types';
|
|
|
|
export const TodoFooter = props => {
|
|
const itemCount = Object.keys(props.todos).filter(id => !props.todos[id].completed).length;
|
|
return (
|
|
<footer>
|
|
<span>
|
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
|
</span>
|
|
<button className="submit">Clear Completed</button>
|
|
</footer>
|
|
);
|
|
};
|