mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
* 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
20 lines
395 B
TypeScript
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>
|
|
);
|
|
};
|