todo
19 строк · 706.0 Байт
1import React from 'react';
2import './ToDoFilter.css';
3
4interface ToDoFilterProps {
5filter: Filter;
6setFilter: React.Dispatch<React.SetStateAction<Filter>>;
7}
8
9const ToDoFilter: React.FC<ToDoFilterProps> = ({ filter, setFilter }) => {
10return (
11<div className="footer">
12<button onClick={() => setFilter('All')} className={filter === 'All' ? 'selected' : ''}>All</button>
13<button onClick={() => setFilter('Active')} className={filter === 'Active' ? 'selected' : ''}>Active</button>
14<button onClick={() => setFilter('Completed')} className={filter === 'Completed' ? 'selected' : ''}>Completed</button>
15</div>
16);
17}
18
19export default ToDoFilter;
20