Files
frontend-bootcamp/step1-07/exercise/src/components/TodoFooter.tsx
Micah Godbolt 7cea32428e Rewrite of Day 1 to use modern React (#294)
* update to hooks

* more class to function

* cleanup

* finish ts final

* update html lesson

* add lessons page

* clean up

* move getters into context

* adding type

* fix bug

* step 5 cleanup

* init final pass

* text tweak

* fix ternaries

* readme cleanup

* fixed root readme
2022-01-13 09:22:50 -08:00

20 lines
395 B
TypeScript

import React from 'react';
export const TodoFooter = (props) => {
const { clearCompleted, todos } = props;
const itemCount = todos.filter((todo) => todo.status === 'active').length;
return (
<footer>
<span>
{itemCount} item{itemCount === 1 ? '' : 's'} left
</span>
<button className="submit">
Clear Completed
</button>
</footer>
);
};