import { View, Text } from 'react-native'
import React from 'react'
import { TextField } from 'react-native-ui-lib'
import CategoryDropdown from './CategoryDropdown'
import { GroceryCategory } from '@/contexts/GroceryContext'

const EditGroceryItem = (props: {title: string, setTitle: (value: string) => void, setCategory: (category: GroceryCategory) => void}) => {
  return (
    <View
          style={{
            backgroundColor: "white",
            width: "100%",
            borderRadius: 25,
            padding: 15,
          }}
        >
          <TextField
            placeholder="Grocery"
            value={props.title}
            onChangeText={(value) => props.setTitle(value)}
            maxLength={25}
          />
          <CategoryDropdown setSelectedCategory={props.setCategory} />
        </View>
  )
}

export default EditGroceryItem