/** * Copyright (C) 2019-2021 Carl Kittelberger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ import React, { ChangeEvent } from 'react'; import FormControl from 'react-bootstrap/FormControl'; import InputGroup from 'react-bootstrap/InputGroup'; import ListGroup from 'react-bootstrap/ListGroup'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { injectIntl, IntlShape } from 'react-intl'; import { RunnerList } from 'util/datatypes/RunnerList'; import VideoListItem from './VideoListItem'; import Filter from './Filter'; import { VideoEntry } from '../util/datatypes/VideoList'; interface VideoListProps { intl: IntlShape, id: string, thumbnailServerURL: string, videos: Array, runners: RunnerList, } interface VideoListState { query: string } class VideoList extends React.Component { constructor(props: VideoListProps) { super(props); this.state = { query: '', }; this.onQueryChange = this.onQueryChange.bind(this); } onQueryChange({ target }: ChangeEvent) { this.setState({ query: target.value, }); } render() { const { query } = this.state; const { intl, id, thumbnailServerURL, videos, runners, } = this.props; return (
filteredVideos.map(({ item: { duration, downloadFileName: fileName, title, run, slug, sourceVideoStart, sourceVideoEnd, thumbnails, }, refIndex: index, }) => ( run?.runners?.includes(r.pk))} duration={duration} id={id} thumbnailServerURL={thumbnailServerURL} fileName={fileName} slug={slug} title={title} sourceVideoStart={sourceVideoStart} sourceVideoEnd={sourceVideoEnd} thumbnails={thumbnails} /> ))} />
); } } export default injectIntl(VideoList);