import { BottomSheetProps } from "@gorhom/bottom-sheet"; import React, { ReactNode, useContext } from "react"; export interface BottomSheetStackItem { component: ReactNode; snapPoints?: string[] | number[]; initialSnapIndex?: number; dynamicSizing?: boolean; bottomSheetProps?: Partial>; } export interface BottomSheetStackContextType { push: (item: BottomSheetStackItem) => void; pop: () => void; replace: (item: BottomSheetStackItem) => void; clear: () => void; // canGoBack: boolean; } export const BottomSheetStackContext = React.createContext(null); export const useBottomSheetStack = () => { const context = useContext(BottomSheetStackContext); if (!context) { throw new Error( "useBottomSheetStack must be used within a BottomSheetStackProvider" ); } return context; };