1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

apply suggestions

This commit is contained in:
grafixeyehero 2022-01-22 19:20:09 +03:00
parent f5b69e0de3
commit 76f9b9c929
4 changed files with 20 additions and 14 deletions

View file

@ -12,16 +12,21 @@ const createSelectElement = ({ className, label, option }) => ({
</select>`
});
type RatingsArr = {
Name: string;
Value: number;
}
type IProps = {
className?: string;
label?: string;
parentalRatings: any
parentalRatings: RatingsArr[];
}
const SelectMaxParentalRating: FunctionComponent<IProps> = ({ className, label, parentalRatings }: IProps) => {
const renderOption = ratings => {
const renderOption = () => {
let content = '';
for (const rating of ratings) {
for (const rating of parentalRatings) {
content += `<option value='${rating.Value}'>${rating.Name}</option>`;
}
return content;
@ -32,7 +37,7 @@ const SelectMaxParentalRating: FunctionComponent<IProps> = ({ className, label,
dangerouslySetInnerHTML={createSelectElement({
className: className,
label: globalize.translate(label),
option: renderOption(parentalRatings)
option: renderOption()
})}
/>
);