import { Text, ScrollView } from "react-native";
import { View } from "react-native-ui-lib";
import React from "react";
import AddGroceryItem from "./AddGroceryItem";
import GroceryList from "./GroceryList";
import { useGroceryContext } from "@/contexts/GroceryContext";

const GroceryWrapper = () => {
  const { isAddingGrocery } = useGroceryContext();
  return (
    <View height={"100%"}>
      <View height={'90%'}>
        <ScrollView>
          <GroceryList />
        </ScrollView>
      </View>
      {!isAddingGrocery && <AddGroceryItem />}
    </View>
  );
};

export default GroceryWrapper;
