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

Use interface over type

This commit is contained in:
grafixeyehero 2022-10-02 19:07:42 +03:00
parent 9d88af3dfe
commit de4a359c98
21 changed files with 100 additions and 106 deletions

View file

@ -1,24 +1,21 @@
import React, { FunctionComponent } from 'react';
import React, { FC } from 'react';
const createElement = ({ id, className }: IProps) => ({
const createElement = ({ className }: IProps) => ({
__html: `<div
is="emby-itemscontainer"
${id}
class="${className}"
>
</div>`
});
type IProps = {
id?: string;
interface IProps {
className?: string;
}
const ItemsContainerElement: FunctionComponent<IProps> = ({ id, className }: IProps) => {
const ItemsContainerElement: FC<IProps> = ({ className }) => {
return (
<div
dangerouslySetInnerHTML={createElement({
id: id ? `id='${id}'` : '',
className: className
})}
/>