1
0
Fork 0
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:
Treycos 2024-08-19 04:01:32 +02:00 committed by GitHub
parent 8af12cc4e7
commit 7dca9060ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 20 deletions

View file

@ -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;

View 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>
);
}