@equinor/fusion-framework-cli
Version:
--- title: Fusion Framework CLI ---
13 lines • 1.03 kB
JavaScript
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?.map((feature) => (_jsxs(Styled.SwitchListItem, { onClick: () => toggleFeature(feature.key), children: [_jsxs(Styled.SwitchLabel, { children: [_jsx(Typography, { variant: "body_short_bold", children: feature.title ?? feature.key }), _jsx(Typography, { variant: "body_short_italic", children: feature.description ?? '' })] }), _jsx(Switch, { checked: feature.enabled, disabled: feature.readonly })] }, `feat-${feature.key}`))) }));
};
export default FeatureTogglerPortal;
//# sourceMappingURL=FeatureTogglerPortal.js.map