mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 07:16:52 -06:00
31 lines
736 B
JavaScript
31 lines
736 B
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const PgAdminContext = React.createContext();
|
|
|
|
export function usePgAdmin() {
|
|
const pgAdmin = React.useContext(PgAdminContext);
|
|
return pgAdmin;
|
|
}
|
|
|
|
export function PgAdminProvider({children, value}) {
|
|
|
|
return <PgAdminContext.Provider value={value}>
|
|
{children}
|
|
</PgAdminContext.Provider>;
|
|
}
|
|
|
|
PgAdminProvider.propTypes = {
|
|
children: PropTypes.object,
|
|
value: PropTypes.any
|
|
};
|