aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/enum.tsx
blob: dee8667903fa97606c8a0a61ef6fcf528d20f117 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as _ from 'lodash';
import * as React from 'react';

import { EnumValue } from '../types';

export interface EnumProps {
    values: EnumValue[];
}

export const Enum = (props: EnumProps) => {
    const values = _.map(props.values, value => {
        const defaultValueIfAny = !_.isUndefined(value.defaultValue) ? ` = ${value.defaultValue}` : '';
        return `\n\t${value.name}${defaultValueIfAny},`;
    });
    return (
        <span>
            {`{`}
            {values}
            <br />
            {`}`}
        </span>
    );
};
/cgit/cgit.cgi/freebsd-ports/log/www/flood?h=dependabot/npm_and_yarn/devel/electron4/files/mixin-deep-1.3.2&id=65d47372c10fae30f89a63d9efc1def5a8a7a364'>flood
Commit message (Expand)AuthorAgeFilesLines
* - bump PORTREVISION on ports with LIB_DEPENDS+= devel/apr1ohauer2013-07-06