@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
25 lines • 831 B
JavaScript
import React, { useMemo } from 'react';
export const AreaContext = /*#__PURE__*/React.createContext({
contentCardType: undefined,
shouldChangeColor: undefined,
shouldDisableListItemPadding: undefined
});
AreaContext.displayName = 'AreaContext';
const AreaContextProvider = ({
children,
contentCardType,
shouldChangeColor = true,
shouldDisableListItemPadding = false
}) => {
const providerValue = useMemo(() => ({
contentCardType,
shouldChangeColor,
shouldDisableListItemPadding
}), [contentCardType, shouldChangeColor, shouldDisableListItemPadding]);
return /*#__PURE__*/React.createElement(AreaContext.Provider, {
value: providerValue
}, children);
};
AreaContextProvider.displayName = 'AreaContextProvider';
export default AreaContextProvider;
//# sourceMappingURL=AreaContextProvider.js.map