mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
e7d7bc79f4
(cherry picked from commit 0e95ba2021b23cc65bce0a0620dd48e355250dab)
44 lines
964 B
TypeScript
44 lines
964 B
TypeScript
import React from 'react';
|
|
import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
|
|
import styles from './UpdateChanges.css';
|
|
|
|
interface UpdateChangesProps {
|
|
title: string;
|
|
changes: string[];
|
|
}
|
|
|
|
function UpdateChanges(props: UpdateChangesProps) {
|
|
const { title, changes } = props;
|
|
|
|
if (changes.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
const uniqueChanges = [...new Set(changes)];
|
|
|
|
return (
|
|
<div>
|
|
<div className={styles.title}>{title}</div>
|
|
<ul>
|
|
{uniqueChanges.map((change, index) => {
|
|
const checkChange = change.replace(
|
|
/#\d{4,5}\b/g,
|
|
(match) =>
|
|
`[${match}](https://github.com/Readarr/Readarr/issues/${match.substring(
|
|
1
|
|
)})`
|
|
);
|
|
|
|
return (
|
|
<li key={index}>
|
|
<InlineMarkdown data={checkChange} />
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default UpdateChanges;
|