Extract components and shapes into their respective modules (#212)

This commit is contained in:
Gasim Gasimzada 2020-01-06 21:29:44 +04:00 committed by GitHub
parent 86a1c29eec
commit 054669cfef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 153 additions and 147 deletions

View file

@ -0,0 +1,25 @@
import React from "react";
export function ButtonSelect<T>({
options,
value,
onChange
}: {
options: { value: T; text: string }[];
value: T | null;
onChange: (value: T) => void;
}) {
return (
<div className="buttonList">
{options.map(option => (
<button
key={option.text}
onClick={() => onChange(option.value)}
className={value === option.value ? "active" : ""}
>
{option.text}
</button>
))}
</div>
);
}