import React from 'react' const headers = { js: "JS", android: "Android", ios: "iOS", macos: "macOS", }; type DocProps = { fieldSpec: { doc?: string values?: { [key: string]: { doc?: string } } 'sdk-support'?: { [key: string]: typeof headers } } }; export default class Doc extends React.Component { render () { const {fieldSpec} = this.props; const {doc, values} = fieldSpec; const sdkSupport = fieldSpec['sdk-support']; const renderValues = ( !!values && // HACK: Currently we merge additional values into the style spec, so this is required // See !Array.isArray(values) ); return ( <> {doc &&
{doc}
{renderValues &&
    {Object.entries(values).map(([key, value]) => { return (
  • {JSON.stringify(key)}
    {value.doc}
  • ); })}
}
} {sdkSupport &&
{Object.values(headers).map(header => { return ; })} {Object.entries(sdkSupport).map(([key, supportObj]) => { return ( {Object.keys(headers).map((k) => { if (Object.prototype.hasOwnProperty.call(supportObj, k)) { return ; } else { return ; } })} ); })}
{header}
{key}{supportObj[k as keyof typeof headers]}no
} ); } }