import React from 'react'; import PropTypes from 'prop-types'; import { Box, Heading } from '@chakra-ui/react'; import { Icon } from '@chakra-ui/react'; import { TaskList } from './components/TaskList'; import { EmptyState } from './components/EmptyState'; import { useTasks } from './useTasks'; const FrownIcon = (props) => ( ); export const InboxScreen = ({ error }) => { const [tasks, dispatch] = useTasks(); const archiveTask = (archive, id) => { dispatch({ type: archive ? 'ARCHIVE_TASK' : 'INBOX_TASK', id }); }; const deleteTask = (id) => { dispatch({ type: 'DELETE_TASK', id }); }; const togglePinTask = (state, id) => { dispatch({ type: state === 'TASK_PINNED' ? 'INBOX_TASK' : 'PIN_TASK', id }); }; const editTitle = (title, id) => { dispatch({ type: 'EDIT_TITLE', id, title }); }; if (error) { return ( ); } return ( Taskbox ); }; InboxScreen.propTypes = { error: PropTypes.string, }; InboxScreen.defaultProps = { error: null, };