UNPKG

@equinor/fusion-framework-cli

Version:

--- title: Fusion Framework CLI ---

16 lines 1.21 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useFrameworkFeatures } from '@equinor/fusion-framework-react/feature-flag'; import { Typography, Switch } from '@equinor/eds-core-react'; import { Styled } from './Styled'; /** * Content for Feature toggler tab for portal features in the PersonSidesheet's Feature page. */ export const FeatureTogglerPortal = () => { const { features, toggleFeature } = useFrameworkFeatures(); return (_jsx(Styled.SwitchList, { children: features === null || features === void 0 ? void 0 : features.map((feature) => { var _a, _b; return (_jsxs(Styled.SwitchListItem, { onClick: () => toggleFeature(feature.key), children: [_jsxs(Styled.SwitchLabel, { children: [_jsx(Typography, { variant: "body_short_bold", children: (_a = feature.title) !== null && _a !== void 0 ? _a : feature.key }), _jsx(Typography, { variant: "body_short_italic", children: (_b = feature.description) !== null && _b !== void 0 ? _b : '' })] }), _jsx(Switch, { checked: feature.enabled, disabled: feature.readonly })] }, `feat-${feature.key}`)); }) })); }; export default FeatureTogglerPortal; //# sourceMappingURL=FeatureTogglerPortal.js.map