mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-19 17:32:38 +01:00
parent
540659a799
commit
644876123d
@ -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 (
|
||||
<Link
|
||||
to={link}
|
||||
title={title}
|
||||
>
|
||||
{title}{year > 0 ? ` (${year})` : ''}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
MovieTitleLink.propTypes = {
|
||||
titleSlug: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
year: PropTypes.number
|
||||
};
|
||||
|
||||
export default MovieTitleLink;
|
26
frontend/src/Movie/MovieTitleLink.tsx
Normal file
26
frontend/src/Movie/MovieTitleLink.tsx
Normal file
@ -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 (
|
||||
<Link to={link} title={title} {...otherProps}>
|
||||
{title}
|
||||
{year > 0 ? ` (${year})` : ''}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
export default MovieTitleLink;
|
Loading…
Reference in New Issue
Block a user