mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
Type Track title
This commit is contained in:
parent
9f405f414e
commit
2a0ea51bca
1 changed files with 12 additions and 2 deletions
|
|
@ -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)
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue