orchidmap-front/src/components/Switch.tsx
2019-02-12 16:20:31 +07:00

14 lines
296 B
TypeScript

// @flow
import * as React from 'react';
import classnames from 'classnames';
type Props = {
active: boolean,
onPress?: () => void,
}
export const Switch = ({ active, onPress = () => {} }: Props) => (
<div
className={classnames('switch', { active })}
onMouseDown={onPress}
/>
);