mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
27 lines
673 B
TypeScript
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);
|