{"size": 559, "ext": "js", "max_stars_repo_path": "yoh-frontend/src/components/InputOrganization/InputOrganization.js", "max_stars_repo_name": "Svyat935/YOH", "max_stars_repo_stars_event_min_datetime": "2022-02-11T20:32:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-11T20:32:35.000Z", "max_issues_repo_path": "yoh-frontend/src/components/InputOrganization/InputOrganization.js", "max_issues_repo_name": "Svyat935/YOH", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "yoh-frontend/src/components/InputOrganization/InputOrganization.js", "max_forks_repo_name": "Svyat935/YOH", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.3043478261, "max_line_length": 99, "alphanum_fraction": 0.5348837209}
import React from "react";
import "./InputOrganizations.css";

export function InputOrganization(props) {
    const createOptions = () => {
        let orgs = props.organizations,
            view = [];

        orgs.forEach((org) => {
            view.push(
                <option selected={org.id === props.defaultValue} value={org.id}>{org.name}</option>
            )
        })

        return view;
    }

    return (
        <select id={"input-organizations"} className={"input-organizations"}>
            {createOptions()}
        </select>
    )
}