import React, { createContext, useContext } from 'react'; interface ArrayItemContextValue { /** Whether this field is rendered within an array item */ isInArrayItem: boolean; /** Whether the array item controls should show collapse/expand functionality */ arrayItemCollapsible: boolean; } const ArrayItemContext = createContext({ isInArrayItem: false, arrayItemCollapsible: false, }); export const useArrayItemContext = () => useContext(ArrayItemContext); interface ArrayItemProviderProps { children: React.ReactNode; isInArrayItem: boolean; arrayItemCollapsible?: boolean; } export const ArrayItemProvider: React.FC = ({ children, isInArrayItem, arrayItemCollapsible = false, }) => { return ( {children} ); };