chore: restructure project into yarn workspaces, remove next

This commit is contained in:
41666 2021-03-09 23:25:16 -05:00
parent 49e308507e
commit 8d06327c03
266 changed files with 16466 additions and 3350 deletions

View file

@ -0,0 +1,28 @@
import * as React from 'react';
import { Item, Wrapper } from './HorizontalSwitch.styled';
export type SwitchProps = {
items: string[];
value: string;
onChange: (value: string) => void;
};
export const HorizontalSwitch = (props: SwitchProps) => {
const handleClick = (item: typeof props.value) => () => {
props.onChange?.(item);
};
return (
<Wrapper>
{props.items.map((item, idx) => (
<Item
key={idx}
selected={item === props.value}
onClick={handleClick(item)}
>
{item}
</Item>
))}
</Wrapper>
);
};