import { CodeSnippet, useKnobValues } from '@fluentui/docs-components'; import { createComponent, Flex } from '@fluentui/react-northstar'; import * as _ from 'lodash'; import * as React from 'react'; const knobsSnippetStyles = { background: 'whitesmoke', color: '#777', lineHeight: '1.5', padding: `5px 10px`, }; export const KnobsSnippet = createComponent({ displayName: 'KnobsSnippet', render: ({ children, config }) => { // createComponent() is not compatible with hooks rules // eslint-disable-next-line const knobs = useKnobValues(); const values = _.fromPairs(knobs.map(knob => [knob.name, knob.value])); return (
{children}
{({ classes }) => ( )}
); }, }); KnobsSnippet.defaultProps = { styles: knobsSnippetStyles, };