UNPKG

@equinor/fusion-framework-cli

Version:

--- title: Fusion Framework CLI ---

16 lines 1.22 kB
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 === null || features === void 0 ? void 0 : features.map((feature) => { var _a; 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 }), 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