sendou.ink/frontend-react/src/components/common/YearDropdown.js
2019-12-27 15:55:04 +02:00

22 lines
501 B
JavaScript

import React from "react"
import { Dropdown } from "semantic-ui-react"
const YearDropdown = ({ value, onChange, startYear = 2018 }) => {
const options = []
for (let index = startYear; index <= new Date().getFullYear(); index++) {
options.push({ key: index, text: index, value: index })
}
return (
<Dropdown
clearable
value={value}
onChange={onChange}
selection
style={{ width: "270px" }}
options={options}
/>
)
}
export default YearDropdown