diff --git a/frontend/src/Movie/MovieTitleLink.js b/frontend/src/Movie/MovieTitleLink.js deleted file mode 100644 index ec23276a5..000000000 --- a/frontend/src/Movie/MovieTitleLink.js +++ /dev/null @@ -1,33 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; -import Link from 'Components/Link/Link'; - -class MovieTitleLink extends PureComponent { - - render() { - const { - titleSlug, - title, - year - } = this.props; - - const link = `/movie/${titleSlug}`; - - return ( - - {title}{year > 0 ? ` (${year})` : ''} - - ); - } -} - -MovieTitleLink.propTypes = { - titleSlug: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - year: PropTypes.number -}; - -export default MovieTitleLink; diff --git a/frontend/src/Movie/MovieTitleLink.tsx b/frontend/src/Movie/MovieTitleLink.tsx new file mode 100644 index 000000000..cd17da0fe --- /dev/null +++ b/frontend/src/Movie/MovieTitleLink.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import Link, { LinkProps } from 'Components/Link/Link'; + +interface MovieTitleLinkProps extends LinkProps { + titleSlug: string; + title: string; + year?: number; +} + +function MovieTitleLink({ + titleSlug, + title, + year = 0, + ...otherProps +}: MovieTitleLinkProps) { + const link = `/movie/${titleSlug}`; + + return ( + + {title} + {year > 0 ? ` (${year})` : ''} + + ); +} + +export default MovieTitleLink;