webamp/js/components/MainWindow/MonoStereo.tsx
2019-03-19 06:55:24 -07:00

27 lines
673 B
TypeScript

import React from "react";
import { connect } from "react-redux";
import classnames from "classnames";
import { AppState } from "../../types";
import * as Selectors from "../../selectors";
interface Props {
channels: number | null;
}
const MonoStereo = (props: Props) => (
<div className="mono-stereo">
<div
id="stereo"
className={classnames({ selected: props.channels === 2 })}
/>
<div id="mono" className={classnames({ selected: props.channels === 1 })} />
</div>
);
const mapStateToProps = (state: AppState): Props => {
return {
channels: Selectors.getChannels(state),
};
};
export default connect(mapStateToProps)(MonoStereo);