Type Track title

This commit is contained in:
Jordan Eldredge 2018-10-11 21:31:10 -07:00
parent 9f405f414e
commit 2a0ea51bca

View file

@ -1,14 +1,24 @@
import React from "react";
import { connect } from "react-redux";
import { getTrackDisplayName } from "../../selectors";
import { AppState } from "../../types";
const TrackTitle = props => (
interface OwnProps {
id: number;
paddedTrackNumber: string;
}
interface StateProps {
title: string | null;
}
const TrackTitle = (props: OwnProps & StateProps) => (
<span>
{props.paddedTrackNumber}. {props.title}
</span>
);
const mapStateToProps = (state, ownProps) => ({
const mapStateToProps = (state: AppState, ownProps: OwnProps): StateProps => ({
title: getTrackDisplayName(state)(ownProps.id)
});