Grégoire Delattre bcadc48d5a Launch prettier with the --fix option
They've changed their default settings, this changes a lot of stuff in
our code base.
2020-04-01 17:55:34 +02:00

27 lines
671 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
import { List } from "immutable";
export const PolochonSelect = ({ value, changeValue, polochonList }) => {
return (
<select
className="form-control"
value={value}
onChange={(e) =>
changeValue(e.target.options[e.target.selectedIndex].value)
}
>
{polochonList.map((el, index) => (
<option value={el.get("id")} key={index}>
{el.get("name")} ({el.get("url")})
</option>
))}
</select>
);
};
PolochonSelect.propTypes = {
value: PropTypes.string,
changeValue: PropTypes.func,
polochonList: PropTypes.instanceOf(List),
};