mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-22 07:43:01 +00:00
Convert SeriesTitleLink to TypeScript
This commit is contained in:
parent
8af12cc4e7
commit
7dca9060ca
2 changed files with 21 additions and 20 deletions
|
@ -1,20 +0,0 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import Link from 'Components/Link/Link';
|
||||
|
||||
function SeriesTitleLink({ titleSlug, title }) {
|
||||
const link = `/series/${titleSlug}`;
|
||||
|
||||
return (
|
||||
<Link to={link}>
|
||||
{title}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
SeriesTitleLink.propTypes = {
|
||||
titleSlug: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
export default SeriesTitleLink;
|
21
frontend/src/Series/SeriesTitleLink.tsx
Normal file
21
frontend/src/Series/SeriesTitleLink.tsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import React from 'react';
|
||||
import Link, { LinkProps } from 'Components/Link/Link';
|
||||
|
||||
export interface SeriesTitleLinkProps extends LinkProps {
|
||||
titleSlug: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export default function SeriesTitleLink({
|
||||
titleSlug,
|
||||
title,
|
||||
...linkProps
|
||||
}: SeriesTitleLinkProps) {
|
||||
const link = `/series/${titleSlug}`;
|
||||
|
||||
return (
|
||||
<Link to={link} {...linkProps}>
|
||||
{title}
|
||||
</Link>
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue