{"size": 1308, "ext": "js", "max_stars_repo_path": "frontend/src/lib/components/PropertiesTable.js", "max_stars_repo_name": "gzog/posthog", "max_stars_repo_stars_event_min_datetime": "2020-04-09T17:02:13.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-16T20:32:35.000Z", "max_issues_repo_path": "frontend/src/lib/components/PropertiesTable.js", "max_issues_repo_name": "gzog/posthog", "max_issues_repo_issues_event_min_datetime": "2021-03-11T06:30:56.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-22T19:38:30.000Z", "max_forks_repo_path": "frontend/src/lib/components/PropertiesTable.js", "max_forks_repo_name": "gzog/posthog", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 31.1428571429, "max_line_length": 68, "alphanum_fraction": 0.3662079511}
import React, { Component } from 'react'
import PropTypes from 'prop-types'

export function PropertiesTable({ properties }) {
    if (Array.isArray(properties))
        return (
            <div>
                {properties.map(item => (
                    <span>
                        <PropertiesTable properties={item} />
                        <br />
                    </span>
                ))}
            </div>
        )
    if (properties instanceof Object)
        return (
            <table className="table">
                <tbody>
                    {Object.keys(properties)
                        .sort()
                        .map(key => (
                            <tr>
                                <th>{key}</th>
                                <td>
                                    <PropertiesTable
                                        properties={properties[key]}
                                    />
                                </td>
                            </tr>
                        ))}
                </tbody>
            </table>
        )
    if (properties === true) return 'true'
    if (properties === false) return 'false'
    return properties ? properties : null
}
PropertiesTable.propTypes = {
    properties: PropTypes.any.isRequired,
}
