()
| 50 | } |
| 51 | |
| 52 | render() { |
| 53 | let playlist = this.props.playlist |
| 54 | const icon = ['fas', (this.state.exporting ? 'sync' : 'download')] |
| 55 | |
| 56 | if (playlist.uri == null) return ( |
| 57 | <tr key={this.props.key}> |
| 58 | <td>{this.renderIcon(playlist)}</td> |
| 59 | <td>{playlist.name}</td> |
| 60 | <td className="d-none d-sm-table-cell" colSpan={2}>{this.props.i18n.t("playlist.not_supported")}</td> |
| 61 | <td className="d-none d-sm-table-cell">{this.renderTickCross(playlist.public)}</td> |
| 62 | <td className="d-none d-md-table-cell">{this.renderTickCross(playlist.collaborative)}</td> |
| 63 | <td> </td> |
| 64 | </tr > |
| 65 | ); |
| 66 | |
| 67 | return ( |
| 68 | <tr key={this.props.key}> |
| 69 | <td>{this.renderIcon(playlist)}</td> |
| 70 | <td><a href={playlist.uri}>{playlist.name}</a></td> |
| 71 | <td><a href={playlist.owner.uri}>{playlist.owner.display_name}</a></td> |
| 72 | <td className="d-none d-sm-table-cell">{playlist.tracks.total}</td> |
| 73 | <td className="d-none d-sm-table-cell">{this.renderTickCross(playlist.public)}</td> |
| 74 | <td className="d-none d-md-table-cell">{this.renderTickCross(playlist.collaborative)}</td> |
| 75 | <td className="text-end"> |
| 76 | {/* @ts-ignore */} |
| 77 | <Button type="submit" variant="primary" size="xs" onClick={this.exportPlaylist} disabled={this.state.exporting} className="text-nowrap"> |
| 78 | {/* @ts-ignore */} |
| 79 | <FontAwesomeIcon icon={icon} size="sm" spin={this.state.exporting} /> {this.props.i18n.t("playlist.export")} |
| 80 | </Button> |
| 81 | </td> |
| 82 | </tr> |
| 83 | ); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | export default withTranslation()(PlaylistRow) |
nothing calls this directly
no test coverage detected