All files / screens manage-habits.js

100% Statements 6/6
100% Branches 4/4
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27              3x   3x   2x   1x                          
import { Box } from '@material-ui/core';
import { HabitList } from 'components/habit-list';
import { FullPageSpinner } from 'components/lib';
import { useHabitsQuery } from 'api/habits';
import { NoHabitsScreen } from 'screens/no-habits';
 
function ManageHabitsScreen() {
  const { data: habits, isLoading } = useHabitsQuery();
 
  if (isLoading) return <FullPageSpinner />;
 
  if (!habits.length) return <NoHabitsScreen />;
 
  return (
    <Box
      sx={{
        width: '100%',
        height: '100%',
      }}
    >
      <HabitList habits={habits} />
    </Box>
  );
}
 
export { ManageHabitsScreen };