2023-01-10 10:04:30 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
export interface AppListContextValues {
|
2023-01-19 11:54:57 +00:00
|
|
|
removeAppInstallation: (installationId: string) => void;
|
|
|
|
retryAppInstallation: (installationId: string) => void;
|
2023-01-10 10:04:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const AppListContext = React.createContext<
|
|
|
|
AppListContextValues | undefined
|
|
|
|
>(undefined);
|
|
|
|
|
|
|
|
export const useAppListContext = () => {
|
|
|
|
const context = React.useContext(AppListContext);
|
|
|
|
|
|
|
|
if (!context) {
|
|
|
|
throw new Error("useAppListContext must be used within a AppListContext");
|
|
|
|
}
|
|
|
|
|
|
|
|
return context;
|
|
|
|
};
|