import {
IonBackButton,
IonButtons,
IonCheckbox,
IonContent,
IonHeader,
IonItem,
IonLabel,
IonList,
IonPage,
IonTitle,
IonToolbar,
} from '@ionic/react';
import { useParams } from 'react-router-dom';
import Store from '../../store';
import * as actions from '../../store/actions';
import * as selectors from '../../store/selectors';
const ListItems = ({ list }) => {
return (
{(list?.items || []).map((item, key) => (
))}
);
};
const ListItemEntry = ({ list, item }) => (
actions.setDone(list, item, !item.done)}>
{item.name}
);
const ListDetail = ({ match }) => {
const lists = Store.useState(selectors.getLists);
const params = useParams();
const { listId } = params;
const loadedList = lists.find(l => l.id === listId);
return (
{loadedList.name}
);
};
export default ListDetail;