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

remove duplicate components

This commit is contained in:
grafixeyehero 2021-10-09 19:35:10 +03:00
parent 9db5773cb9
commit 39c742af9d
3 changed files with 54 additions and 60 deletions

View file

@ -1,26 +1,28 @@
import React, { FunctionComponent } from 'react';
const createCheckBoxElement = ({Name, Id}) => ({
type IProps = {
className?: string;
Name?: string;
Id?: string;
}
const createCheckBoxElement = ({className, Name, Id}) => ({
__html: `<label>
<input
type="checkbox"
is="emby-checkbox"
class="chkChannel"
data-id="${Id}"
type="checkbox"
is="emby-checkbox"
class="${className}"
data-id="${Id}"
/>
<span>${Name}</span>
</label>`
});
type IProps = {
Name?: string;
Id?: string;
}
const NewUserChannelAccessList: FunctionComponent<IProps> = ({Name, Id}: IProps) => {
const CheckBoxListItem: FunctionComponent<IProps> = ({className, Name, Id}: IProps) => {
return (
<div
dangerouslySetInnerHTML={createCheckBoxElement({
className: className,
Name: Name,
Id: Id
})}
@ -28,5 +30,5 @@ const NewUserChannelAccessList: FunctionComponent<IProps> = ({Name, Id}: IProps)
);
};
export default NewUserChannelAccessList;
export default CheckBoxListItem;

View file

@ -1,32 +0,0 @@
import React, { FunctionComponent } from 'react';
const createCheckBoxElement = ({Name, Id}) => ({
__html: `<label>
<input
type="checkbox"
is="emby-checkbox"
class="chkFolder"
data-id="${Id}"
/>
<span>${Name}</span>
</label>`
});
type IProps = {
Name?: string;
Id?: string;
}
const NewUserFolderAccessList: FunctionComponent<IProps> = ({Name, Id}: IProps) => {
return (
<div
dangerouslySetInnerHTML={createCheckBoxElement({
Name: Name,
Id: Id
})}
/>
);
};
export default NewUserFolderAccessList;