brutal-legends/src/components/sort-select.tsx

25 lines
636 B
TypeScript
Raw Normal View History

2020-03-05 08:07:46 +01:00
import React from "react";
2020-03-05 18:09:48 +01:00
export default (props: Props) => {
2020-03-05 08:07:46 +01:00
const { value, handleOnChange } = props;
return (
<div hidden>
<label htmlFor="sortBy">Sortera efter</label>
<select
id="sortBy"
value={value}
onChange={evt => handleOnChange(evt.target.value)}
>
<option value="id">Inköpsdatum</option>
<option value="artist">Artist</option>
<option value="year">År</option>
</select>
</div>
);
};
2020-03-05 18:09:48 +01:00
type Props = {
2020-03-05 08:07:46 +01:00
value: string;
handleOnChange: Function;
2020-03-05 18:09:48 +01:00
};