"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHostsTableDetailContext = exports.HostsTableDetailContextProvider = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const HostsTableDetailContext = react_1.default.createContext(undefined);
const HostsTableDetailContextProvider = ({ canEditDisks, onDiskRole, updateDiskSkipFormatting, children }) => {
    const context = {
        canEditDisks,
        onDiskRole,
        updateDiskSkipFormatting,
    };
    return (react_1.default.createElement(HostsTableDetailContext.Provider, { value: context }, children));
};
exports.HostsTableDetailContextProvider = HostsTableDetailContextProvider;
const useHostsTableDetailContext = () => {
    const context = react_1.default.useContext(HostsTableDetailContext);
    if (context === undefined) {
        throw new Error('useHostTableDetailContext must be used within a HostsTableDetailContextProvider');
    }
    return context;
};
exports.useHostsTableDetailContext = useHostsTableDetailContext;
//# sourceMappingURL=HostsTableDetailContext.js.map