import React, { useEffect, useState } from 'react'; import { Box, CircularProgress, makeStyles, TextField } from '@material-ui/core'; import { useQueryParams } from '../../../../common/hooks/useQueryParams'; import { useEmail } from '../../hooks/useEmail'; import { EmailList } from '../shared/EmailList'; const useStyles = makeStyles((theme) => ({ search: { zIndex: 5, position: 'absolute', backgroundColor: theme.palette.primary.light, top: 0, }, })); export const InboxPage = () => { const classes = useStyles(); const { inbox, fetchInbox, loading } = useEmail(); const { autoSearch } = useQueryParams<{ autoSearch }>(); const [search, setSearch] = useState(''); useEffect(() => { fetchInbox(); }, [fetchInbox]); const handleSearch = (e) => { setSearch(e.target.value); }; return ( {!inbox && loading ? ( ) : ( )} ); };