mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-27 02:43:57 +02:00
Convert SeriesTitleLink to TypeScript
This commit is contained in:
parent
8af12cc4e7
commit
7dca9060ca
@ -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 New Issue
Block a user