@equinor/fusion-framework-cli
Version:
--- title: Fusion Framework CLI ---
15 lines • 1.11 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useCurrentAppFeatures } from '@equinor/fusion-framework-react/feature-flag';
import { Typography, Switch } from '@equinor/eds-core-react';
import { Styled } from './Styled';
/**
* JSX structure for Feature toggler tab for app features in the PersonSidesheet's Feature page.
*/
export const FeatureTogglerApp = () => {
const { features, toggleFeature } = useCurrentAppFeatures();
return (_jsx(Styled.SwitchList, { children: features?.map((feature) => {
return (_jsxs(Styled.SwitchListItem, { onClick: () => toggleFeature(feature.key), children: [_jsxs(Styled.SwitchLabel, { children: [_jsx(Typography, { variant: "body_short_bold", children: feature.title ?? feature.key }), feature.description && (_jsx(Typography, { variant: "body_short_italic", children: feature.description }))] }), _jsx(Styled.Switch, { children: _jsx(Switch, { checked: feature.enabled, disabled: feature.readonly }) })] }, `feat-${feature.key}`));
}) }));
};
export default FeatureTogglerApp;
//# sourceMappingURL=FeatureTogglerApp.js.map