mirror of
https://github.com/sct/overseerr.git
synced 2025-09-27 04:22:37 +02:00
feat(ui): added content ratings for tv shows and movie ratings (#878)
This commit is contained in:
@@ -129,7 +129,22 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
||||
revalidate();
|
||||
};
|
||||
|
||||
const movieAttributes = [];
|
||||
const movieAttributes: React.ReactNode[] = [];
|
||||
|
||||
if (
|
||||
data.releases.results.length &&
|
||||
(data.releases.results.find((r) => r.iso_3166_1 === 'US')?.release_dates[0]
|
||||
.certification ||
|
||||
data.releases.results[0].release_dates[0].certification)
|
||||
) {
|
||||
movieAttributes.push(
|
||||
<span className="p-0.5 py-0 border rounded-md">
|
||||
{data.releases.results.find((r) => r.iso_3166_1 === 'US')
|
||||
?.release_dates[0].certification ||
|
||||
data.releases.results[0].release_dates[0].certification}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (data.runtime) {
|
||||
movieAttributes.push(
|
||||
@@ -369,7 +384,13 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
||||
)}
|
||||
</h1>
|
||||
<span className="mt-1 text-xs lg:text-base lg:mt-0">
|
||||
{movieAttributes.join(' | ')}
|
||||
{movieAttributes
|
||||
.map((t, k) => <span key={k}>{t}</span>)
|
||||
.reduce((prev, curr) => (
|
||||
<>
|
||||
{prev} | {curr}
|
||||
</>
|
||||
))}
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative z-10 flex flex-wrap justify-center flex-shrink-0 mt-4 sm:justify-end sm:flex-nowrap lg:mt-0">
|
||||
|
Reference in New Issue
Block a user